Results 1 to 4 of 4

Thread: Cron.PHP for Drupal?

  1. #1
    JohnMorris is offline Certified Glow Sage
    Join Date
    Oct 2007
    Posts
    32

    Default 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

  2. #2
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    5,929

    Default

    well if you want to run it as the user and you have shell access then execute this from the commandline:

    Code:
    crontab -eu cpuser
    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.
    Last edited by Matt; 06-27-2008 at 08:18 PM.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  3. #3
    JohnMorris is offline Certified Glow Sage
    Join Date
    Oct 2007
    Posts
    32

    Smile 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

  4. #4
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    5,929

    Default

    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...
    Last edited by Matt; 06-27-2008 at 09:38 PM.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14