EDIT:
i am getting a 406 error page with this cron!
here is the crontab (copied from cPanel):
* * * * * GET https://abc.com/cron/sendBulletinEmails.php >>
/home/abc/public_html/cron/logs/sendBulletinEmails.log
here is the log:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>406 Not Acceptable</title>
</head><body>
<h1>Not Acceptable</h1>
<p>An appropriate representation of the requested resource /cron/sendSurveyEmails.php could not be found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
here is my crontab:
* * * * * { cd /var/www/cron && /usr/bin/php -f sendQueuedEmails.php ;} | /usr/bin/logger -t sendQueuedEmails
i am running ubuntu.
i am not seeing any logs in:
/var/log/cron
/var/log/messages
/var/mysql/log
where can it be?
grep "CRON" /var/log/syslog
It should be noted that A) you're not redirecting standard error. So if your scripts are bombing, the errors won't result in the messages file. So put a
2>&1
before the pipe. B) Cron doesn't have squat for environment variables. Are you sure your php script is actually working? There's a good chance it's choking, and hence why there's no output. Try sourcing in your login script like so:. /home/user/.bashrc
--Christopher Karel
it wasn't logging anything. after using GET in my cron (thanks to this answer), i append the output to a log file, like so: