Last updated February 24, 2014. Created by ericatkins on July 14, 2007.
Edited by Zach Harkey, thoughmas, olafveerman, LeeHunter. Log in to edit this page.

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.

Screenshot

Setup Cron Jobs on Mediatemple DV Server on Drupal 7

We want cron to run every 10 minutes, but Drupal's cron only allows for 1 hour granularity.

  1. In the Drupal admin Go to Report > Status Report
  2. Copy your unique cron key url from the cron maintenance tasks section.
  3. In Mediatemple's plesk, open Websites & Domains > Scheduled Tasks > click your username > click Schedule New Task and enter this info:

Minute: */10
Hour: *
Day of Month: *
Month: *
day of Week: *
Command: curl http://yourdomain.com/cron.php?cron_key=1Vulq8M6-xW4cG0F8ewU5PeckY39_MW6...
For the command field I used "curl" and the url I copied in step 2.

Note about Chroot

If your FTP accounts are chrooted then cron will not run because curl command cannot run in the chrooted environment. In order to allow curl to run try these steps:

  1. SSH into your server as root or equivalent user.
  2. Run this command
  3. /usr/local/psa/bin/server_pref --update -crontab-secure-shell ""

  4. If you ever need to undo this setting (but it will stop cron from running again):
  5. /usr/local/psa/bin/server_pref --update -crontab-secure-shell /bin/bash

Reference on chroot and curl command: http://kb.parallels.com/en/115889

To Turn off cron email alerts:

Login to Plesk, go to Home > Subscriptions > domain.com > Websites & Domains > Scheduled Tasks > Settings

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

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.

Read About Webcomics At ComixTalk!

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.)

To test, simply run the command in shell. If nothing returns, it works and you can put that in the crontab.

--
Fredric

I currently use MT GS and have found the following settings to work:

First enter your email and then use:

curl http://mt-example.com/cron.php

You should get an email like this:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0

also check your logs for success.

Then reset the command line to:

curl --silent http://mt-example.com/cron.php

In the future, you only receive an email if there is an error.

Thanks, Stephen

I don't know if it's because of (mt) but i can't run cron.php with my key (even if I'm logged in as admin) I tried clicking the url the status/report page generates, copy and paste, diff browsers, clear caché but nothing works all the time I get Access Denied. My cron job is correctly configured since i get the response via mail (tho' with the same Access Denied page) so I wonder if it is the hosting or drupal itself... perhaps a module? (I'm using, Views, Mollom, Chaos Tools, Video JS, Token and Pathauto)
I would appreciate any response on this

regards