Created
September 1, 2014 19:46
-
-
Save timabell/72dad13e48573891acc4 to your computer and use it in GitHub Desktop.
rsnapshot anacron script
This file contains 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/sh | |
# to be called from anacron. | |
# first arg is name of backup set to run | |
if [ ! -d /backup/ ]; then | |
echo "ERROR: backup disk not mounted at /backup/, aborting" | |
exit 1 | |
fi | |
/usr/bin/rsnapshot $1 | |
echo "rsnapshot $1 done" | |
if [ "$1" = "daily" ]; then | |
echo "--- diff: ---" | |
/usr/bin/rsnapshot diff | |
fi | |
echo "--- usage: ---" | |
/usr/bin/rsnapshot du | |
echo "--- du: ---" | |
/bin/ls -l /backup/ | |
/bin/df -h /backup/ | awk '{print $4 "\t" $5}' # avail + % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment