Skip to content

Instantly share code, notes, and snippets.

@timabell
Created September 1, 2014 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timabell/72dad13e48573891acc4 to your computer and use it in GitHub Desktop.
Save timabell/72dad13e48573891acc4 to your computer and use it in GitHub Desktop.
rsnapshot anacron script
#!/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