(gs) Cron jobs for Grid-Service
NOTE:
Please be aware of the following limits that are enforced for all cron jobs on the (gs) Grid-Service:
- 5 minutes of CPU time
- 15 minutes of actual time
- 200 simultaneous file descriptors
- 100MB of RAM
- 5 simultaneous processes
DETAILS:
NOTE:
Please be aware of the following limits that are enforced for all cron jobs on the (gs) Grid-Service:
- 5 minutes of CPU time
- 15 minutes of actual time
- 200 simultaneous file descriptors
- 100MB of RAM
- 5 simultaneous processes
This article details how to set up a cron job on a (gs) Grid-Service in a few simple steps:
- Log into the AccountCenter and use the Admin button to navigate to your (gs) Grid-Service.
- Click on the Cron Jobs button near the bottom of the page:
- Click on Add new cron job button near the top of the page:
- If you would like the output of the cron job to be sent to your email address please provide it in the first field. If this box is left empty no output or error messages will be sent.
NOTE:
If your script has no output you will not receive an email.
- Fill out the Command to Run field. If you wish to run a custom script make sure you've uploaded the script to a directory on your server. Then provide the complete path to your script. This is an example of a full path to a script.
- To run a Shell or Perl script:
/home/#####/data/script-name.sh - To run a PHP script via command-line:
To run as PHP5 via the command-line:php /home/#####/data/script-name.php
php5 /home/#####/data/script-name.php - The command-line curl client allows you to fetch a page from a webserver and the output is sent to you via email (if the email field above is filled in). To run a PHP script via curl:
Another option for curl is adding the 'silent' option so you won't receive emails unless errors are reported:curl http://mt-example.com/script-name.phpcurl -sS http://mt-example.com/script-name.php
- To run a Shell or Perl script:
- Choose the time and frequency with which you would like to run your script. You can use some of the predefined values like Every hour or Every 5 Minutes. If you use the Specify option, the list of numbers allows you specify what minute of the hour you want the cron job to run. For example, if you select '3', then the cron job will run at 10:03, 11:03, 12:03, etc. You can select multiple numbers, but they must be at least five minutes apart.
NOTE:
The maximum frequency that your script can be run is in 5 minute intervals. The cron will use the PST time zone.
- Review the values you have entered into each field and click save. If you selected to have the output emailed to you it should arrive shortly after the command or script has finished.

NOTE:
-
If you are running a shell script instead of a built-in command you must make sure that your script is executable and has the correct ownership. The command following will make your script executable.
chmod +x /path/to/script -
In any field you can select multiple settings by holding the Ctrl-key (PC) or command-key (OS X) down while clicking on your selection to highlight multiple entries (see screenshot above for an example).
Revisions:
07-27-2009: Added information regarding site number.
02-02-2009: Added Curl silent information. Thanks to Jordie for the comment.
01-23-2009: Article formatting cleaned up
Fields marked with an asterisk(*) are required. Comment on this article