Created
October 21, 2015 23:17
-
-
Save maxdml/6ce8a0229420ff76a478 to your computer and use it in GitHub Desktop.
a backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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