
Originally Posted by
peter
On a related topic, I'm looking into methods of backing up the DB with a call to suspend the forums and then reactivate them after the backup is complete. At the moment I just stop apache and run the mysql backup.
Any suggestions?
You could use a cron job and call this script.... I call this script 4 times a day for my forums and then use rsync to move copies of the database backups to several servers several times a day as well. The "--opt " locks the tables while backing up. So I never turn off apache at all.
Code:
-------------------------------------------------------------------------
#!/bin/sh
for i in `mysql -B -e "show databases" | tail +2`; do
mysqldump --opt $i | gzip -9 > /var/backups/mysql/$i.`date --iso-8601`.gz
ls -t /var/backups/mysql/$i.* | tail +7 | xargs rm -f
done
Bookmarks