« qmail and its 30 second delay. | Main | mysql dump and restore. »

simple backup scripts.

i think there's a golden rule in system administration: never underestimate the importance of backups. i have a few small scripts that you can use with rsync or just local that i decided may be useful, and i'm going to share them here. maybe later on when i master rsync, i'll post a tutorial about it here as well.

a mysql backup may work for you as follows:
mysqldump -A --password=xxxxxx | gzip > /root/mysql_backup/`date +%m%d%y_%T`.sql.gz

on the other hand, if you want to backup all qmail for a particular domain, you can attempt to do a job as such:

tar zcvf /root/domain/mailbackup-`date +%m%d%y_%T`.tar.gz /var/qmail/mailnames/domain.com/

i have a cron job that runs nightly to execute these tasks, and i find them rather useful, especially since the inclusion of the timestamp gives me an idea of what could have happened and when.

TrackBack

TrackBack URL for this entry:
http://www.ramblingsofasysadmin.com/cgi-bin/mt/mt-tb.cgi/7

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)