Last active
October 30, 2016 20:26
-
-
Save coaxial/06aa9e665bfbb791ad7e1409fa5d2d17 to your computer and use it in GitHub Desktop.
quick bash script to make system backups
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
#!/usr/bin/env bash | |
# tar -zcpf /mnt/storage/backups/`date "+%Y%m%d_%H%M%S"`_`hostname`.tar.gz --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=media --exclude=srv --exclude=mnt . | |
tar -jcpf /mnt/storage/backups/"$(date "+%Y%m%d_%H%M%S")"_"$(hostname)".tar.bz2 --one-file-system / | |
# Sample cron entry to run sysbackup every day at 4:52am, assuming this script is executable in /usr/bin/ | |
# 52 4 * * * sysbackup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment