Skip to navigation
Simple backup script with rsync
10.12.13
time=`date +%d` mysqldump -u root -h 127.0.0.1 -pxxx --all-databases > "/mnt/bak/servername/db_${time}.sql" mysqldump -u root -h 127.0.0.1 -pxxx foosql1 > "/mnt/bak/servername/foosql1_${time}.sql" gzip -f "/mnt/bak/servername/db_${time}.sql" cp "/mnt/bak/servname/shopsql1_${time}.sql" /var/customers/webs/foo/db/foosql1.sql gzip -f "/mnt/bak/servname/foosql1_${time}.sql" gzip -f "/var/customers/webs/foo/db/foosql1.sql" rsync --backup --backup-dir=`date +%Y.%m.%d` \ --exclude='logs' \ --exclude="webalizer" \ --exclude=".hg" \ -arv --no-owner --no-group --no-perms /var/customers /mnt/bak/servername rsync --backup \ --backup-dir=`date +%Y.%m.%d` \ --exclude='ssl_apache2' \ --exclude='ssl.bak' \ --exclude='mysql' \ -arv --no-owner \ --no-group \ --no-perms /etc /mnt/bak/servername ls /mnt/bak/servername -all | mail -s"Backup servername.com" foo@bar.com python /var/customers/webs/foo/sendreport.py backup_com
Reply
Anonymous
Information Epoch 1732521324
Think hierarchically.
Home
Notebook
Contact us