-
Cron.PHP for Drupal?
Hi,
I'm successfully using Drupal now for standupsales.com.
I'd like to get cron running, which is required for various functions in Drupal, including indexing and backups. In know GlowHost backs things up, but it would be nice to have automatic downloads offsite. Right now I do it manually.
I'm a newbie for cron, it looks fairly simple, but what is a good command line please to set cron.php running, which is in the root of the domain and part of the Drupal setup? Actually "looks" is probably misleading, as there are multiple ways it seems to run it, but depending on the host.
Thanks!
John
-
well if you want to run it as the user and you have shell access then execute this from the commandline:
Which will pull up the crontab editor for this cPanel user you have defined. Meaning "cpuser" is your cpanel username for the site that you want the cron setup for.
Then add something like this:
Code:
MAILTO=you@yourdomain.com
0 4 * * * php /home/cpuser/cron.php
The above assumes you have cron.php setup in the site root where the below could likely be used if the cron.php is in the web root, assuming that executing cron.php in a browser works...
Code:
MAILTO=you@yourdomain.com
0 4 * * * GET http://yourdomain.com/cron.php
Both of the above fire off the script at 4 AM server time and email the results to the address you specify in the "MAILTO" line.
-
Shell Access
Matt,
Thanks for the helpful reply. I always think your replies may be helpful to others as well. You mentioned about shell access. I tried accessing for the first time my account via Putty, and had generated the keys. I have successfully used Putty in other SSH environments. But apparently I don't have shell access yet? Is this because of the nature of my account? Do I need to upgrade, or just request, or somehow turn on shell access? If this is documented somewhere, I'd be happy to read it, but didn't find it.
Thanks!
John
-
You are welcome.
If you have a dedicated server or VPS you can login with your root logins. If you are on a shared host you would need to request it at our helpdesk so that it can be enabled.
I forgot to mention that if you do not need a shell these commandlines can also be entered into your cPanel > Cron Jobs > Advanced or just type in "cron" into the jump menu on the top left of the cPanel interface and it will show you the icon you are after... :)