Created
August 16, 2016 05:03
-
-
Save dkrnl/be4580aed4da3f53e12e232ec171b647 to your computer and use it in GitHub Desktop.
Backup root directory + tar gzip
This file contains hidden or 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 | |
cd /var/backups/root | |
# backup root folders | |
tar -cvzf root.$(date +%F).tgz /bin/ /boot/ /etc/ /home/ /lib/ /lib64/ /opt/ /root/ /sbin/ /usr/ | |
# remove older backups | |
find /var/backups/root -type f -name '*.tgz' -mtime +30 -delete | |
# todo rsync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment