Created
June 27, 2012 13:20
-
-
Save afeijo/3004029 to your computer and use it in GitHub Desktop.
Backup all sites files
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 | |
# crontab example: | |
# 2 */12 * * * /bin/sh /home/user/scripts/sites.sh | |
# Local directory for dump files | |
LOCALDIR=$HOME/backups/sites | |
# | |
##################################### | |
### Edit Below If Necessary ######### | |
##################################### | |
cd $LOCALDIR | |
DATE=`eval date +%Y%m%d-%H%M` | |
# compactar a pasta sites | |
tar zcf sites_${DATE}.tgz /var/nginx/www -X $HOME/scripts/exclude.list | |
# proteger os arquivos | |
chmod 0440 *gz | |
# Delete older files | |
find $LOCALDIR -mtime +15 -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment