Skip to content

Instantly share code, notes, and snippets.

Created January 30, 2018 16:35
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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 =
print(day_to_slot(n - 1))
rsync -avz --link-dest=/data/backup/$YESTERDAY ~ remote:/data/backup/$TODAY
ssh remote touch /data/backup/$TODAY
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" .

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