Created
September 18, 2014 07:59
-
-
Save dedeibel/271ed7dc928c1ea7ef4d to your computer and use it in GitHub Desktop.
create an archive using tar (see also backup and withbackupdevice)
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/bash | |
set -e | |
cd / | |
if [ ! -f /backup/ready ]; then | |
echo "backup device not ready" | |
exit | |
fi | |
DATE=`date +%Y-%m-%d` | |
STDOUT=/var/log/archive-${DATE}.log | |
echo "starting " `date +%Y-%m-%d` | tee -a "$STDOUT" | |
tar -cvpzf /backup/fullbackup-$DATE.tar.gz --exclude-from=/etc/backup_excludes --exclude-backups --exclude-caches-all / 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