I have a script that I use along side a cronjob to update my site daily by creating a copy of a dynamic file on my site. The script works fine for several days in a row, and then for no apparent reason, the script will write a blank file instead of copying the dynamic file.
Here's my script:
<?php
ob_start();
passthru("/usr/bin/wget -q 'http://www.mysite.com/index.php' -O - 2>&1");
$html = ob_get_contents();
ob_end_clean();
// write output to file
$fp = fopen("index.html", "w");
fwrite($fp, $html);
fclose($fp);
?>
I have several other scripts like this one on the site, and they all stop and start working at the same time. Anybody have a clue as to why the script would be writing a blank file instead of retrieving the contents of the other file?