Skip to content

Instantly share code, notes, and snippets.

@maxdml
Created October 21, 2015 23:17
Show Gist options
  • Select an option

  • Save maxdml/6ce8a0229420ff76a478 to your computer and use it in GitHub Desktop.

Select an option

Save maxdml/6ce8a0229420ff76a478 to your computer and use it in GitHub Desktop.
a backup script
#!/usr/bin/bash
#DATE=`date +"%m%d%y_%H:%M:%S"`
DATE=`date`
DIR='[your home directory]/results/'
LOG_FILE="results.log"
echo "[$DATE] New backup starting..." >> $DIR/$LOG_FILE
rsync="/usr/bin/rsync -zavHe ssh --omit-dir-times csstudent@[mother-ip]:/var/results $DIR >> $DIR/$LOG_FILE"
echo "[$DATE]" $rsync >> $DIR/$LOG_FILE
$(/usr/bin/rsync -zavHe ssh --omit-dir-times csstudent@[mother-ip]:/var/results/ $DIR >> $DIR/$LOG_FILE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment