September 7, 201115 yr I'm looking to create or use a script to backup a MySQL database automatically on a weekly basis. I'd prefer to have the backups emailed to the client and it mustn't take any work on the clients end. What do people around here use? This is a custom developed PHP/MySQL site.
September 7, 201115 yr Generally I'll use a custom script per client, using the command line if possible to mysqldump the db, compress it and put into cloud storage. E-mailing it is OK but if the email inbox is hosted on the same server, it's actually pretty pointless
September 7, 201115 yr Author Generally I'll use a custom script per client, using the command line if possible to mysqldump the db, compress it and put into cloud storage. E-mailing it is OK but if the email inbox is hosted on the same server, it's actually pretty pointless Email is hosted on several separate servers so that shouldn't be a problem.
September 7, 201115 yr http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html
September 7, 201115 yr NB: One hiccup with automated backup scripts is the hosting servers CRON account often has insufficient permissions set to send email. So you may need to look at using another method to trigger the backup script using either a responce to an event (or series of events) inside the website or from an external call. A Google App engine performing a URL fetch using it's own cron timer is one method, it's an ugly fudge but it works.. The other is to use an include on all the sites pages that checks the database size periodically and performs the backup based upon time difference between present date and last backup or increase in size.
Create an account or sign in to comment