[root@WEBSERVER02 ~]# more /etc/cron.hourly/fhc_backup.sh #!/bin/sh #stop the mysql slave thread but let the i/o thread run so it catches up faster to the master /usr/bin/mysql -e 'stop slave sql_thread;' #dump the database and compress it while appending the full date /usr/bin/mysqldump fhc_vbulletin | gzip -9 > /forumbkp/fhc_vbulletin-$(date +%F--%T).sql.gz #start the sql thread again /usr/bin/mysql -e 'start slave sql_thread;' #remove backups older than 48 hours cd /forumbkp ls -t | sed -e '1,48d' | xargs -d '\n' rm