Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/data/backup/$TODAY#!/bin/bash -e
read -r YESTERDAY TODAY <<<$(
python3 -c '
import datetime
def day_to_slot(n):
return bin(n)[::-1].index("1")
n = datetime.date.today().toordinal()
print(day_to_slot(n - 1))
print(day_to_slot(n))
')
rsync -avz --link-dest=/data/backup/$YESTERDAY ~ remote:/data/backup/$TODAY
ssh remote touch /data/backup/$TODAY
@minimo24

This comment has been minimized.

Copy link

minimo24 commented Jul 8, 2018

What is the meaning of "/data/backup/$TODAY#!/bin/bash -e" on the first line of the script? I get the #!/bin/bash part but wonder about $TODAY. Seems to be an environment variable like $PATH but nothing is displayed with "echo $TODAY" .

@RGD2

This comment has been minimized.

Copy link

RGD2 commented Apr 27, 2019

James explains it over here

The stuff before the # on the first line I think is just a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.