Obsolete Releases > SME 8.x Contribs
Using cron to run a php file
(1/1)
animare:
Hi,
I run man drupal sites using the sme server and I would like to run a cron.php file.
I am using webmin to create a scheduled cron job.
I can successfully run the cron job using wget and a url pointing to the cron file.
But I really want to run the cron file locally. i.e.
/home/e-smith/files/ibays/drupalsite/html/cron.php
I have tried many ways but none seem to work. e.g :
/usr/bin/php /home/e-smith/files/ibays/drupalsite/html/cron.php
php /home/e-smith/files/ibays/drupalsite/html/cron.php
etc.
Any help would be great!
Thanks
Apologies if posting this in the wrong place.
mmccarn:
My crontab (login as root; crontab -e) uses a cd command before running a local php, like this:
--- Code: ---* * * * * cd /home/e-smith/files/ibays/sugarcrm/html; php -f cron.php > /dev/null 2>&1
--- End code ---
However, I don't think I ever got local php execution working for Drupal, so my crontab line for that looks like this:
--- Code: ---45 * * * * /usr/bin/wget -O - -q -t 1 --no-check-certificate https://mind.yourown.biz/cron.php?cron_key=jpGWAhDarVIgareyoukiddingpGgK54wMwSBsKRpZsY > /dev/null 2>&1
--- End code ---
animare:
Thanks,
That first command didn't work for drupal, I'm going to keep trying till I find a way!
I'll post back if I figure it out
animare:
I think I'm trying to do something that cannot be done in sme server.
Drupal docs says that using wget is the recommended way anyway so I'm probably just wasting time.
Thanks again
animare:
I figured out how to do it:
--- Code: ---/usr/bin/drush -r /home/e-smith/files/ibays/d7anim/html cron > /dev/null 2>&1
--- End code ---
You must have drush installed on your server. But it is very easy to install.
I think it is much better to run cron locally, especially if you have your ibay locked down with password (Or you use a .htacesss file)
Navigation
[0] Message Index
Go to full version