Last active
August 16, 2016 05:07
-
-
Save dkrnl/0016c9c49853a0f1c3058be266d16487 to your computer and use it in GitHub Desktop.
Backup sites in www directory
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 | |
cd /var/backups/www | |
# backup www folders | |
for i in `find /www/* -type d -nowarn -maxdepth 0 -exec basename {} \;`; | |
do | |
tar -cvzf $i.$(date +%F).tgz /www/$i | |
done | |
# remove older backups | |
find /var/backups/www -type f -name '*.tgz' -mtime +15 -delete | |
# todo rsync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment