Last updated February 18, 2014. Created on September 1, 2009.
Edited by tvn, ajeancharles, Shane Birley, olafveerman. Log in to edit this page.
Setting up a cron job on Rackspace Cloud Sites is a straight forward process and can be set up any number of ways.
- Log in to your Rackspace Cloud account.
- Select the domain you want to update.
- Click on the Features tab.
- Scroll down to the cron job list. Click on add new task.
- Enter a task name. NOTE: The task name can be anything.
- (Optional) If you would would like to receive a notification e-mail when the cron is complete, check Send me an email and enter the e-mail address you would like the cron system to notify. The e-mail contains the results of the cron job and can be useful for debugging but can be annoying if you receive one for a simple cron task.
- For Command Language, select http.
- For Command to Run, enter the URL of the cron.php file in your Drupal installation. For example, you would enter:
- Drupal 6
http://www.example.com/cron.php - Drupal 7
1) Choose to enter your email if you want to get a notification
2) Choose the command language: PHP
3) Type the command to run "web/content/cron.php". Note need to specify the "Document" folder
- Drupal 6
- Select the Repeat by the: drop down and select the interval to run the task. Generally, it is recommended to run the maintenance cron task once an hour. In the drop down, select hour and then choose the frequency and the minute (0 - 59).
- Click on Save Task.
- You're done!
Explanation for Drupal 7. The PHP interpreter is being called directly from the directory where it is intalled. Since the call source is local, no key is needed. However you have to go and modify the cron.php file, to tell it where to find "bootstrap.php"; see the illustration below.
The function call "getcwd()" in cron.php does not resolve to the "Document" folder, but 2 folders above that. So cron.php will be looking for bootstrap.php in the wrong folder. You need to add "/www.youdomainname.com/web/content" to the return string of "getcwd()".
| Attachment | Size |
|---|---|
| 34.69 KB |
Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.
Comments
Use http as the command language instead of php
For the D7 example above: If you use http as the command language (it's the last option in the dropdown) instead of php, you can just use the url with the cron key as normal. That way there's no need to hack core.
--------------------
Sean B. Fuller
www.seanbfuller.com
Forgive my inexperience, but
Forgive my inexperience, but doesn't Drupal 7 include poormanscron? If that is true, is there even a need to set a server task as well?
While D7 does include
While D7 does include poormanscron, I believe it results in cron processes being run in the context of a user's page request. This isn't ideal as it can cause very long page loads (albeit for only one user every few hours). Using cron also allows you to control when these tasks are managed. This is sometimes necessary for larger sites with more complex cron needs.
--------------------
Sean B. Fuller
www.seanbfuller.com