Hi
running Cpanel 6 on Linux
Kernel version: 2.4.18-27.7.x
Apache version: 1.3.27 (Unix)
MySQL version: 4.0.12
I've tried all the options I can find for cron and still have had no joy with receiving forum notifications unless I manually trigger cron.php from a browser... doing it that way the mail arrives, so I presume the problem is with the cronjob config not the mail setup.
From Cpanel's info I've tried:
5 * * * * GET http://mydomain.com/path/admin/cron.php > /dev/null
and
*/5 * * * * GET http://mydomain.com/path/admin/cron.php > /dev/null
from the moodle install documentation I've tried:
*/5 * * * * wget -q -O /dev/null http://mydomain.com/path/admin/cron.php
and
5 * * * * wget -q -O /dev/null http://example.com/moodle/admin/cron.php
None of these have worked... does anyone have tried and tested Cpanel 6 cronjob syntax??
Regards
David
Hi,
Never used Cpanel 6 myself, but I just used the sample cron file supplied with Moodle.
In the admin directory, you will find a file "crontab.in"
This contains the default settings to run the cron function, every 5 minutes, using the command line version of php. You need to edit this file to check that the paths are all correct.
To install this file, change to the moodle/admin directory and issue the following commands
crontab -l >> crontab.in
crontab crontab.in
You do this from the command line, preferably as user "root". The first command lists and existsing cron settings, and adds them to the end of the moodle cron file, the second command then installs all the cron jobs.
This shuld get everything working, but get back to us if there are any errors or problems with this proceedure.
Good luck,
David
Never used Cpanel 6 myself, but I just used the sample cron file supplied with Moodle.
In the admin directory, you will find a file "crontab.in"
This contains the default settings to run the cron function, every 5 minutes, using the command line version of php. You need to edit this file to check that the paths are all correct.
To install this file, change to the moodle/admin directory and issue the following commands
crontab -l >> crontab.in
crontab crontab.in
You do this from the command line, preferably as user "root". The first command lists and existsing cron settings, and adds them to the end of the moodle cron file, the second command then installs all the cron jobs.
This shuld get everything working, but get back to us if there are any errors or problems with this proceedure.
Good luck,
David
Actually there is no such crontab.in file included with Moodle, David L.
David K, you might a need a full path for wget. eg /usr/bin/wget or something.
David K, you might a need a full path for wget. eg /usr/bin/wget or something.
Ooops,
Well MY moodle admin directory has one - but I can't remember where it came from.
Would it help to have a simple little script that locates where php is on your system, and uses this to created the desired crontab entry?
It would only take a few minutes for me to whip one up if desired.
David
Well MY moodle admin directory has one - but I can't remember where it came from.
Would it help to have a simple little script that locates where php is on your system, and uses this to created the desired crontab entry?
It would only take a few minutes for me to whip one up if desired.
David
It would be cool if, when it couldn't find 'php' (because command-line php isn't that common) that it also looked for wget, lynx etc and basically advised on the best thing to do. Oh yes, and it would be extra nice if it checked crontab for an existing entry just in case it's been run twice.
(Gosh it's nice being on this side of the fence for a change! )
(Gosh it's nice being on this side of the fence for a change! )
This is the command I use in Cpanel 6:
15 * * * * GET http://mydomain.com/admin/cron.php > /dev/null
Gives an hourly command.
Seems to work fine.
Ray
Interesting point that Ray
your command should give you 15 minute cronjobs
I finally got mine to work using WGET
5 * * * * wget http://mydomain.com/path/admin/cron.php > /dev/null
and I also get hourly cronjobs... I'm thinking that maybe the server host has the capability to limit the frequency of cronjobs for cpanel clients... if I find out any more I'll post again here
cheers for the help
David
your command should give you 15 minute cronjobs
I finally got mine to work using WGET
5 * * * * wget http://mydomain.com/path/admin/cron.php > /dev/null
and I also get hourly cronjobs... I'm thinking that maybe the server host has the capability to limit the frequency of cronjobs for cpanel clients... if I find out any more I'll post again here
cheers for the help
David
to get 15 minute cronjobs, or 5 minute cronjobs you need to use:
*/15 * * * * wget ....
or
*/5 ....
if you use:
5 * * * * wget ...
you are telling cron to run at 0:05, 1:05, 2:05 ...
with */5 its 0:05, 0:10, 0:15 (every minute that is divisible by 5).
*/15 * * * * wget ....
or
*/5 ....
if you use:
5 * * * * wget ...
you are telling cron to run at 0:05, 1:05, 2:05 ...
with */5 its 0:05, 0:10, 0:15 (every minute that is divisible by 5).
Gracias Héctor....
Its certainly been complicated getting my head round how cron works... cheers for the info
Its certainly been complicated getting my head round how cron works... cheers for the info