Skip to content

Instantly share code, notes, and snippets.

Created September 9, 2010 17:05
Show Gist options
  • Save anonymous/4a2bc30681f640ffd044 to your computer and use it in GitHub Desktop.
Save anonymous/4a2bc30681f640ffd044 to your computer and use it in GitHub Desktop.
#!/bin/bash
# fecha has a formated date
fecha=`date +"%d-%m-%Y"`
# Backup and gzip the directory
#tar zcvf /backups/trunk-$fecha.tgz /var/www/repository
tar zcvf /mnt/nfs_backups/YOdesa/var-log-$fecha.tgz /var/log
tar zcvf /mnt/nfs_backups/YOdesa/var-www-$fecha.tgz /var/www
tar zcvf /mnt/nfs_backups/YOdesa/etc-$fecha.tgz /etc
# Rotate the logs, delete older than 7 days
find /mnt/nfs_backups/YOdesa/ -mtime +7 -exec rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment