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 | |
# Tar shit up: | |
today=$(date '+%d_%m_%y') | |
echo "* Performing domain backup..." | |
tar czf /var/backups/constantshift.com_"$today".tar.gz -C / var/www/constantshift.com | |
echo "* Backed up..." | |
# Remove shit older than 7 days: | |
MaxFileAge=7 | |
find /var/backups/ -name '*.gz' -type f -mtime +$MaxFileAge -exec rm -f {} \; | |
# Rsync shit to the grid: |
NewerOlder