Travis Derouin wrote:
Hi,
We've been using mysqldump to do daily full database backups in case our hardware on our DB server fails. This causes some problems because for a short period of 4 minutes or so, the site in inaccessible because mysqldump has the db locked.
We backup every day at 4h00 - here is the "sophisticated" mechanism we use.
#!/bin/sh # # Get the date as a timestamp # date=`date '+%Y%m%d'` # # Make a hot copy of the MySQL DB # /usr/bin/mysqlhotcopy -h bushido.mcgill.ca -u root wikidb /tmp # # Make a tar of the DB files # cd /tmp tar cf /opt/DB/wikidb$date.tar wikidb # # Make a tar of the wiki files # cd /opt tar cf /opt/DB/wikifiles$date.tar mediawiki # # Clean up old files # rm -rf /tmp/wikidb cd /opt/DB gzip *.tar
enjoy - the hot backup is really short.
r