I have set up crontab to call /cron.php using the following command:
0 3 * * * /usr/bin/php -f /var/www/vhosts/blow-back.ca/httpdocs/cron.php
The file is being executed as the search function seems to be up-to-date, I am receiving the following error message:
PHP Notice: Undefined index: SCRIPT_FILENAME in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 119
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 120
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 169
PHP Notice: Undefined index: SCRIPT_NAME in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 170
PHP Warning: session_start(): Cannot send session cookie - headers already sent in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 748
PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 748
PHP Notice: Undefined index: REMOTE_ADDR in /var/www/vhosts/blow-back.ca/httpdocs/includes/bootstrap.inc on line 757
I do not know much about crontab and I am not sure how to fix this problem. Is anyone able to offer some help?
Comments
use wget
you should use wget to execute your cron jobs.
0 3 * * * wget http://www.example.com/cron.php
wget
When I used wget, the cron daemon simply sent me an email with the contents of the file /cron.php but nothing was executed. Is there something I need to add to the command line to stop this from happening?
I use "Get"
I use "GET" not wget. Also, make sure there are no extra spaces or line feeds at the end of cron.php.
Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in Your Database
NancyDru
How to run wget
By default, cron mails any output of any process to the owner of the crontab entry.
This should work if wget is in the path:
43 * * * * wget -q -O - http://www.example.com/cron.php >/dev/null 2>&1
This will run wget 43 minutes after the hour, every hour, every day, month, year.
-q means shut up and don't emit diagnostic messages.
-O - means write the fetched data (if any) to stdout rather than a file
http://www.example.com/cron.php is the url
>/dev/null redirects stdout to the netherworld
2>&2 redirects stderr to the netherworld
Thanks!
Thanks, that worked like a charm, I've been trying to get that to work for an hour or so!