This has me utterly mystified. I have a cron that runs a php script. It used to work... now it doesn't, and nothing's been done to it. There are two parts to this problem... the cron and the script.
Here's the cron...
*/10 * * * * root cd /usr/share/cms; /usr/bin/php5 /usr/share/cms/cron/cronsendmail.php > /var/log/cms/cronmail.log >/dev/null 2>&1
The way I read that, every ten minutes, the Apache server,acting as root, runs a script called cronsendmail.php and any output ought to be written to cronmail.log.
It certainly runs, because if I delete cronmail.log, ten minutes later, it's back. The problem is, it's an empty file.
Therefore, I'm guessing the problem lies within the script. I'll post the entire script below... I've looked over it dozens of times and I can not see any error.
//max emails per session
$maxe = 50;
//set up the date
$dte = date("Y-m-d", time());
$dx = explode("-",$dte);
$sqldate = $dx."-".$dx."-".$dx;//yyyy-mm-dd
//connect to master
$mlink = @mysql_connect("localhost", "user", "password", TRUE) or die("Couldn't connect : ".mysql_error());
@mysql_select_db('filename', $mlink) or die("Couldn't open filename : ".mysql_error());
// I've sanitised user, password and filename, or course... they are correct in the running version.