By GavinC on
Hello everyone. I am after some help with CRON. All i want it to do is automatically run the http://website.com/cron.php every 45minutes or so.
I had put this line into the Crontab -e:
45 * * * * /usr/bin/wget -O - -q -t 1 http://www.website.com/cron.php
But this is not working from what i can see as nothing is being put into the Watchdog log.
So i gave Poormanscron a go. Again, i set the time interval to 45 minutes, and again nothing.
Where am i going wrong? Please help.
Comments
i have just run the command
i have just run the command
/usr/bin/wget -o - -q -t 1 http://yellow-zebra.co.uk/cron.phpand it worked in the command line. Why wont it work in Crontab -e?
shouldn't the cron job call
shouldn't the cron job call scripts/cron-lynx.sh or scripts/cron-curl.sh ? that's what all of mine do... not sure of the pros/cons of those scripts vs wget.
Do you have the full command
Do you have the full command that is need please?
here's my Drupal cron job (daily)
00 4 * * * /path/to/drupal/scripts/cron-lynx.sh
and of course be sure to edit cron-lynx.sh to use your domain name.
also be sure that the web server user is able to execute the script. (i had to chmod 755.)
I would note two
I would note two things:
1)
There is a 'bug' in Drupal6.8 which affects some hosts. In /includes/bootstrap.inc Line 279:
This new part, which increases security, does not allow a blank http_host.
If it is blank, one repercussion is that cron fails without error.
You might need to change this part to:
A fix is due for subsequent drupal versions, so we won't have to keep patching this.
2)
Many hosts don't allow wget. In this case you may have to use something like:
php /home/[username]/public_html/cron.php
Further advice, I would get it working without any switches, before attempting to add them in.
I found that my host wouldn't allow some of them, which stop cron working at all.
Ok i have changed the
Ok i have changed the bootstrap.inc Line 279 to what you have suggested. I will try and see if this runs.
Thank you for your help :)
> Ok i have changed the
> Ok i have changed the bootstrap.inc Line 279 to what you have suggested. I will try and see if this runs.
Remember that if you are affected by the http_host thing, cron might *still* not run due to 2) or something similar. So I would just keep the edit in no matter what; it won't do any harm, and will take one potential problem out of the equation for further troubleshooting.
Just to show you how finicky it can be, this line doesn't run on my host (cpanel backend):
php /home/[name]/public_html/dev/cron.php > /dev/null
however, this does:
php /home/[name]/public_html/dev/cron.php> /dev/null
But the first one (space before the chevron) is what was in all the tutorials!
It took me two solid days to get cron working due to this little anomaly.
Also, another thing to watch out for: If you get a cron command to run but it silently crashes apache, you'll get a dump placed in your drupal root. these files are large, and can be generated every time a malformed cron command is run. So don't leave your cronjob overnight until you are sure that everything is fine (yes, I did go to bed and woke up to find my webspace full).
ok after the change i have
ok after the change i have no cron running or an error report.
@Anti:
Where is this line?
That is for the 'cpanel-11'
That is for the 'cpanel-11' backend which many, if not most, webhosts provide for their customers.
There is a 'cron section' and a text field in which to type the command.
The example was just to show you that one wrong character can stop cron from running completely.
ahhhh, got you. ok well
ahhhh, got you. ok well after some messing about, i have finally got Cron to run. Thanks for your help.