I'm not the big expert on running crons, but when I run the cron at my website by putting the domain url into the browser:
http://www.domain.com/cron.php
It doesn't seem to actually work. So I logged directly into the server (it's my server) as root and tried to run it in a terminal. Whether I ran it as root or changed permissions or whatever it returned these results (this is from running it in a terminal):
/var/www/web6/web/cron.php: line 1: ?php: No such file or directory
/var/www/web6/web/cron.php: line 2: //: is a directory
/var/www/web6/web/cron.php: line 4: /bin: is a directory
/var/www/web6/web/cron.php: line 5: bin: command not found
/var/www/web6/web/cron.php: line 6: syntax error near unexpected token `('
/var/www/web6/web/cron.php: line 6: ` * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).'
It doesn't appear to be doing anything or finding stuff that it's expecting. What am I doing wrong?
Here's what the body of the cron.php looks like (if the site let's me post it):
// $Id: cron.php,v 1.28 2005-01-09 09:22:38 dries Exp $
/**
* @file
* Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
*/
include_once 'includes/bootstrap.inc';
include_once 'includes/common.inc' ;
// If not in 'safe mode', increase the maximum execution time:
if (!ini_get('safe_mode')) {
set_time_limit(240);
}
// Check if the last cron run completed
if (variable_get('cron_busy', false)) {
watchdog('cron', t('Last cron run did not complete.'), WATCHDOG_WARNING);
}
else {
variable_set('cron_busy', true);
}
// Iterate through the modules calling their cron handlers (if any):
module_invoke_all('cron');
// Clean up
variable_set('cron_busy', false);
watchdog('cron', t('Cron run completed'));
Comments
Have you tried browsing to it?
www.yourdomain.com/cron.php
Then go back to your site and check your log, see if it ran.
Many things can interfere with cron. On the server side, sometimes cron gets hung up and needs to be restarted. On the Drupal side, just having too much cron-triggered stuff happening can drive it to timing out. Sometimes playing with the time between cron runs can fix that kind of thing.
Without more specifics I can't really say what else.
Laura
_____ ____ ___ __ _ _
pingVision, LLC • BlogHer • rare pattern • scattered sunshine
_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet
This issue was resolved (see EDIT below)
...was running it from the browser. "Last cron run did not complete."
I'm a cron newbie, so I don't have any other cron type things running on this site. I haven't even figured out how to make my aggregator automatically update itself yet (doing it manually).
what more specifics do you need? It's located on my site listed below. A standard drupal installation with the following installed:
"Fancy" theme with phptemplate engine
Shoutbox
Chatbox
FCKeditor
Captcha (inactive)
adminblock
flexiblock (not being used)
front page (not being used)
im (not being used)
logintoboggan
weight
Whether I run the cron.php file from the browser or from the command line, regardless of the time of day or the weather conditions, it does not appear to run properly.
Vince
EDIT: This issue was resolved as per the following thread:
http://drupal.org/node/54014
---------
The hottest Linux distribution? Ubuntu
Talk about Ubuntu Web Servers at:
http://www.ubuntuwebservers.com
cron.php requires php
It looks to me like you can't run cron.php without doing it through apache. That means you need to enter it into the url of a browser or use wget to execute it under apache.
I've had terrible trouble getting it to work on site5 using their cron job format because the environment isn't properly configured. I suspect this is the problem for most drupal users.
I solved the problem by putting the cron job on my server to run as often as I need it using wget like this:
10 * * * * wget http://www.example.com/cron.php
with crontab -e
of course I change my default editor to gedit or I use joe because I can't stand vi/vim....
Now my server executes cron.php from the web which goes into my site properly via apache in the environment that works. It's the only reliable way to get cron.php to work for me, and I use two different isp's. Both have the same problem.
Incidently, if cron.php is not executed on a regular basis and you make heavy use of mysql with packges like webfm you will eventually hang your site. Whatever cron.php does, is essential if you are making a lot of file changes, updates, etc.....
Until recently when it hung I'd just manually run cron.php and everything gets fixed. I expect some ISP's out there are having mysql problems they don't understand because of the php/drupal environment issues that prevent a simple run of cron.php.
It's really too bad that this issue can't be resolved some other way.
Len Umina
WT6G
Hi Len, Can you be more
Hi Len,
Can you be more specific -- how did you set this up on Site5? I am having an awful time with this. thanks!
cg
It depends on the site5 account
It had a bit of a hard time getting site5 cron to work. The full details are here:
http://drupal.org/node/265829#comment-992370
I ended up using:
curl http://www.example.com/cron.php > /dev/null 2>&1
Alan Davison
www.caignwebs.com.au
Alan Davison
cron not running properly
I finally got my crontab set up via cpanel /home/my_username/public_html/cron.php. The email that I got after it had run had these lines:
/home/fdp/public_html/quakers/cron.php: line 1: ?php: No such file or directory
/home/fdp/public_html/quakers/cron.php: line 2: //: is a directory
/home/fdp/public_html/quakers/cron.php: line 4: /aquota.user: Permission denied
/home/fdp/public_html/quakers/cron.php: line 5: access-logs: command not found
/home/fdp/public_html/quakers/cron.php: line 6: syntax error near unexpected token `('
/home/fdp/public_html/quakers/cron.php: line 6: ` * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).'
curl, wget and lynx are disabled on the server for security reasons. How do I get around this?
Poormanscron
The above module is a last resort fix for cron issues. You didn't list "get" in the above list. The comment above, has a link to how I looked around a Site5 server to figure out what to do. This was from a shell window.
While local cron is best, and poormanscron is the second worst option and manual running the worst; the next best option to local cron is that you can set up a cron process or scheduled event up on any server to call cron.php, and use this to remotely trigger the sites cron. I think I've even seen websites promoting this option. A quick google search should find some of these.
Alan Davison
www.caignwebs.com.au
Alan Davison