PDA

View Full Version : Cron Backup Script Pls...


xTerMn8R
08-21-2004, 08:03 PM
Can any one guide me as to How I'd create a script to backup 1 MySQL database using Vbulletin's Scheduler? I use windows 2000 server and vb3.03 I'vetried using this ./includes/cron/backup.php file below, which works fine (the commands) if I telnet and run them from the command line, but doesnt seem to work right using a cron Scheduler, It creates the file but zero Bytes.
<?php
exec ('mysqldump --add-drop-table -u**** -p**** ctcforum >w:\vBackups\test.sql');
?>


Thanks ...
Peace...

okrogius
08-22-2004, 02:28 AM
You shouldn't do this, as if you have a large forum you will receive corrupt backups due to php timeouts. Rely on your OS way of doing crons or scheduled tasks.

xTerMn8R
08-22-2004, 07:38 PM
Hey thanks for the Suggestion okrogius, I created a batch file on my server that shells out and runs the mysqldump command and parameters with Windows Task Scheduler and Man this has made my life easy...

Just wish I could Name the file, appended with the date each time it backs up, any suggestions? I'll do some Batch research, havent worked with batch files in a long time ...

Anyway Thanks Again... Server and Site healthy and backed up... :up:

Peace...

Got it with a vb Script that calls tha batch ...

Dennis Olson
08-23-2004, 01:34 PM
Just wish I could Name the file, appended with the date each time it backs up, any suggestions?

That's a no-brainer. I create a time/datestamp var in my cron script, and append the contents of the var to the file name (which I set to "ForumBackup"). So my filename ends up being:

ForumBackup-20040815-1345

Works every time....

xTerMn8R
08-23-2004, 10:21 PM
Yep I found a visual basic script Stores and passes the date to a shell Var. that is then called to date exactly as ur's except I took the hr and min out.

Thanks for the relpy...

Peace...