Created
September 18, 2014 07:57
-
-
Save dedeibel/9b3587b6e809f692cdda to your computer and use it in GitHub Desktop.
run backup using rsync (see also archive and withbackupdevice)
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
#!/bin/bash | |
set -e | |
cd / | |
if [ ! -f /backup/ready ]; then | |
echo "backup device not ready" | |
exit | |
fi | |
DATE=`date +%Y-%m-%d` | |
STDOUT=/var/log/backup-${DATE}.log | |
echo "starting " `date +%Y-%m-%d` | tee -a "$STDOUT" | |
# -n - preview | |
rsync -u -aAXv --delete --delete-excluded --exclude-from=/etc/backup_excludes /* /backup/current 2>&1 | tee -a "$STDOUT" | |
echo "done " `date +%Y-%m-%d` | tee -a "$STDOUT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment