reds Posted January 18, 2007 Share Posted January 18, 2007 Has anyone made a script for this yet to automatically backup and email the database on the nightly cronjob? Would be really useful. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
Adam Posted January 18, 2007 Share Posted January 18, 2007 Hey, I think this should be left up to you to do, or at least you should already have backups enabled on your server. You can enter the following cronjob command which will do the trick. mysqldump -u username -h localhost -pPASSWORD database_name | gzip -9 > /home/USERNAME/backup_db.sql.gz the password has to be RIGHT next to the -p part with no spaces. Replace database_name with the database name. Replace username with the username for mysql. From, Adam 0 Quote Link to comment Share on other sites More sharing options...
reds Posted January 18, 2007 Author Share Posted January 18, 2007 Thanks Adam, I'll have a look at that. I understand what you're saying about backups should bealready enabled ... but I'd like the extra ability to have it email me a copy every night aswell. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.