cron job set up

cron job set up

by Peggy Murrah -
Number of replies: 1
Hello,

I have installed the bulk of Moodle and it works perfectly with the exception of the cron job.

My web host gives examples of cron jobs:

#A cron job every monday at midnight 11:30 PM
30 23 * * 1 /homepages/xx/dxxxxxxxx/cgi-bin/members.cgi

The Moodle install instructions give examples such as:

*/5 * * * * wget -q -o /dev/null http://example.com/moodle/admin/cron.php

I have set the cron exactly like this (using putty):

crontab -e
*/5 * * * * wget -q -o /dev/null http://onepagewebdesign.com/SOA/moodle/admin/cron.php
:wq

When I go back to check via crontab -l, nothing shows up.

I gave up and tried to set up the cron through cronjob.de, and when I submitted the information, I received this message:

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cronjob.de/httpdocs/content/newjob.php on LINE 196

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cronjob.de/httpdocs/content/newjob.php on LINE 201

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cronjob.de/httpdocs/content/newjob.php on LINE 206

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cronjob.de/httpdocs/content/newjob.php on LINE 211

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cronjob.de/httpdocs/content/newjob.php on LINE 216

My web host does support cron jobs and I saw a referece to a wget, so it seems I should have no problems using that command.

I would love any suggestions to troubleshoot this. Thanks.
Peggy
Average of ratings: -
In reply to Peggy Murrah

Re: cron job set up

by Sean S -
You may not be able to use the wget command - my host also restricts that. The cron job I am using which works for me is:

*/5 * * * * /usr/local/bin/php /www/path/to/admin/cron.php >>/www/path/to/logs/cron.log 2>>/www/path/to/logs/cron.err
I hope this helps.