Community Documentation

Running cron manually

Last updated February 9, 2012. Created by Senpai on July 12, 2007.
Edited by mcpuddin, heather, olafveerman, Dave Reid. Log in to edit this page.

To run cron manually in Drupal 7

Go to Administration > Reports > Status report. Scroll down to "Cron maintenance tasks" and click "run cron manually" at http://example.com/admin/reports/status/run-cron

In that same section, core also provides a link with a unique cron_key to run cron from outside your site.

To run cron manually in Drupal 5 and 6

To run a cron job manually, simply visit your own site's url at http://example.com/cron.php with your web browser, and cron will run and complete in the background. You'll be left with a blank white page, which is normal. Use the browser's back button to return to the previous page and continue where you left off. It doesn't matter how long you wait while you're seeing the blank white page, and returning to the previous page at any time won't stop the cron process from running.

Core provides a convenience link for running cron manually too. Look at the Status page's link: /admin/logs/status/run-cron?destination=admin%2Flogs%2Fstatus. You can paste that into your own site's address bar any time you want to run a cron.

In addition, if you have the update_status.module installed, and you should since it's simply glorious, you'll be presented with a custom link on your admin/logs/updates page.

For Drupal 6.x, see in your site: Administer > Reports > Status report > Cron maintenance tasks > Run cron manually.

Comments

Security risk - this sounds dangerous...

Does cron.php check that the request has been initiated from 'localhost' or the same domain/id address?

So I can go around the Internet, find Drupal installations and start triggering their cron jobs? Flooding a server with requests to call a probably expensive and database intensive process seems like a very very easy way to bring down a website...

----------------------
http://tomcarnell.com

Tested this out and you are

Tested this out and you are correct. Cron is able to be run from outside the network. It's an easy fix however. Just place a directive for cron.php in the .htaccess file of your site's main folder. Then use order deny, allow directives to disallow cron.php from being run from outside your network (deny all). Make sure that you allow on your own network ip address range or domain name so you can run cron manually and to allow crontab to access the resource if you have it set up.

ex.

<Files cron.php>
   Order deny, allow
      deny from all
      allow from [your domain or ip address range]
</Files>

Drupal Cron Jobs

For those of you interested in configuring cron so you don't have to run cron manually, here's a video and post on how: http://www.freelancedrupaldeveloper.ca/drupal-cron-jobs

Poorman's cron is also a popular way of getting cron.php to run if you don't have access to the web server's crontab file:

http://drupal.org/project/poormanscron

Problem of Running cron.

When i Try to run Cron it redirect to "users/admin".
Can some one help me to solve this problem?

Fixed

Try to disable PHP filter run cron & enable PHP filter

exit();

If you have any exit();'s in your php (without some sort of $_REQUEST variable initiating it)... your cron will fail.