Configuring cron jobs on Media Temple Grid Servers (gs)

Last modified: December 30, 2008 - 20:16

Through my experience and to my knowledge, cron jobs on Media Temple's Grid Servers must be run via an .sh file in the "/scripts" directory of your Drupal installation. This was confusing to me as I've always setup cron jobs in cPanel. Media Temple does not use cPanel. Following the steps to setup a cron job like 45 * * * * /usr/bin/wget -O - -q http://www.example.com/cron.php through a typical cPanel interface will not work in Media Temple's cron job creation tool.

Use the following steps to get cron jobs working on a Media Temple Grid Server:

  1. Log into your (mt) AccountCenter and go to your WebControl panel.
  2. Click on the "Cron Jobs" icon to enter the cron configuration page.
  3. Select the "Add a new cron job" button.
  4. Enter an email address for the "Output email". Note:Leave this blank if you don't want constant emails.
  5. Enter the following in the "command to run" text box:
    curl http://www.example.com/cron.php
    where "example.com" is your domain name.
  6. Under "Scheduling Settings" select how often you want your cron job to run.
  7. Note the Media Temple will not allow a cron job to run more often than "every 5 minutes".
    • To setup a cron job to run once an hour:
      • Under the "minutes" entry, specify the minute value on which the cron job will start each hour.
      • Then select the following radio boxes: hour, day, month, day of the week.

Having Issues with Cron on Media Temple

xerexes - January 29, 2009 - 04:31

I'm confused - you mention having run the .sh file in the scripts directory up top but then your directions seem to be just to call the cron.php file? Did you do anything else?

I did what you laid out in the steps and it's not working (I think it did for awhile) -- the MT help desk tried to tell me its' the DRUPAL script because running

php5 /home/56241/domains/comixtalk.com/html/cron.php

through the shell gives a bunch of errors:

Warning: include_once(./includes/bootstrap.inc): failed to open stream: No such file or directory in /nfs/c03/h04/mnt/56241/domains/comixtalk.com/html/cron.php on line 9

Warning: include_once(): Failed opening './includes/bootstrap.inc' for inclusion (include_path='.:/usr/local/php-5.2.6-1/share/pear') in /nfs/c03/h04/mnt/56241/domains/comixtalk.com/html/cron.php on line 9

Fatal error: Call to undefined function drupal_bootstrap() in /nfs/c03/h04/mnt/56241/domains/comixtalk.com/html/cron.php on line 10

I haven't figured this out yet but if anyone has had luck with MT Grid Service please chime in! Thanks.

Instructions worked!

astridman - February 26, 2009 - 22:21

The instructions did work for me.

I setup my job to run hourly and wasn't sure if it would be run immediately and then every 60 minutes thereafter(?)

But it appears that the jobs run 'on the hour': 12:00, 1:00, 2:00 etc. Presumably, if you setup a job to run every 15 minutes then they would run at 12:00, 12:15, 12:45, 1:00 etc.

I received the cron job email, thinking there would be some kind of description of what had or had not been done to my drupal installation, but really it doesn't show much of anything. But checking my drupal admin showed that the job had indeed run, working its magical healing powers.

Also, I have a grid-service (gs) account and cron setup appears to different for a dedicated-virtual (dv) account. See here: http://drupal.org/node/271617

(this is my first contribution to the community. I feel good. real good.)

 
 

Drupal is a registered trademark of Dries Buytaert.