I have a simple task I've set up to dump my database every week then compact it to a gz file, here is the php that does it:
Code: Select all
<?
set_time_limit(0);
$now = date("m-d-Y",time());
exec("d:\\mysql\\bin\\mysqldump -u root -pmypassword mydatabase > d:\\backups\\data-".$now.".sql");
echo "backup has been done";
exec("tar -cf data-".$now.".tar data-".$now.".sql");
exec("gzip -9 data-".$now.".tar");
unlink("data-".$now.".sql");
?>
this worked fine using task scheduler on my old machine (php 4.3 on windows 2000). Now for some reason it dies when using task scheduler or cron after the data dump is complete (it doesn't do the tar or the gzip portion). If however I run it from the command line manually, it works fine, it also works fine if I hit it from the web. It's only when I use cron or task scheduler that it doesn't work. I really don't want to have to do this every week manually so any insights you can think of to help me fix this in either cron or task schduler would be appreciated. The environment is the same as what it worked on before other than I have php 5 on my new machine (but still windows 2000)
edit: I tried removing the echo thinking that might have been causing it to bomb, but still doesn't work....