Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scotje/336600 to your computer and use it in GitHub Desktop.
Save scotje/336600 to your computer and use it in GitHub Desktop.
# Save a copy of this file to the backup directory
THEDATE=`date +"%Y%m%d"`
THETIME=`date +"%H%M%S"`
filedata=`cat`
mkdir -p "$TM_BACKUP_DIR/$THEDATE"
echo "$filedata" > "$TM_BACKUP_DIR/$THEDATE/$TM_FILENAME.$THEDATE.$THETIME.backup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment