Use Curl to import MySQL database?

Joined
Jan 24, 2008
Messages
1,200
Reaction score
340
I have a small problem that maybe someone on here can help me out with. I have a MySQL database that is the back end for a website of mine. Although I allow users to make changes to the demo website I need it to reset back to it's original data every 6 hours (maybe every 24hrs). This would require me to make a copy of the database (I can just store it in a directory on my website and kick off a cron job that would import the sql file (and overwrite the existing data).

Anyone know the syntax for this cron job (I don't have to use Curl).
 
Someting like this? * 6 * * * php /home/account/restore_database.php > /dev/null
 
Php script to restore db from dump? Try this http://d15.biz/blog/2006/12/restore-mysql-dump-using-php/
 
Back
Top