Created
February 20, 2014 08:57
-
-
Save waitman/9109538 to your computer and use it in GitHub Desktop.
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 | |
#create a backup of /etc using the date in the archive name. | |
#set schedule in cron | |
#example: | |
# 17 * * * * /backup-etc.sh | |
DATE=$(date +"%Y%m%d%H%M") | |
touch /var/opt/etc-backup-$DATE.tar.gz | |
chmod 600 /var/opt/etc-backup-$DATE.tar.gz | |
tar czfP /var/opt/etc-backup-$DATE.tar.gz /etc | |
tar tvf /var/opt/etc-backup-$DATE.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment