![]() |
How to setup Cron to backup MySQL DBs
Can someone explain or link a tuorial on how to backup all my MySQL databases with a Cron? I'd like to back them up like Mon, Wed, Fri and have a copy emailed to me. I think this is just a matter of automating mysqldump on all the db's, but I haven't set this up before. Thanks. :)
|
crontab entry:
0 1 * * 1,3,5 /usr/bin/mysqldump -q -u username -p"password" databasename > /tmp/file.sql;gzip /tmp/file.sql;/var/www/email.pl email.pl Code:
#!/usr/bin/perl -w |
Thanks for the info cd34! Time to start automating these things. :)
|
I did it about the same way that cd34 posted but since I learned ho to do rsync I stopped having things mailed to me and just do the database dump to my server's drive. I then have my laptop's cron do rsync each night and keep a mirror of my server on my laptop which includes the database dumps.
I setup seven different dumps each week so that I have seven versions of my databases. |
All times are GMT -4. The time now is 09:35 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc