vlad Posted July 26, 2011 Posted July 26, 2011 Is their any way to make a cron that backs up your sql files to a different database every midnight? Quote
Uridium Posted July 27, 2011 Posted July 27, 2011 Im not sure but i did do a script that would backup SQLS to a folder on your FTP will have to dig it out... Quote
Xanthia Posted July 27, 2011 Posted July 27, 2011 Assuming you mean MySQL: @daily mysqldump -uusername -ppassword database > /home/user/database-`date +%Y%m%d`.sql For example: @daily mysqldump -uxan -pnotmypass xandb1 > /home/xan/xandb1-`date +%Y%m%d`.sql would produce the file xandb1-20110727.sql assuming I ran it when I posted this reply - but every day would produce a new .sql dumpfile with a different date-stamp. Far from perfect, but it provides a limited backup capabaility. Look at the options to mysqldump to fine tune it. @daily btw is equivalent to 0 0 * * * Quote
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.