Follow us on Twitter!
Login - Register - Latests submissions

fp

fp's picture

Me on the web

My website
http://thejibe.com

History

Member for
1 year 6 weeks

Tips submitted by fp

Cron is a deamon which triggers certain actions (cron jobs) at configured times. Windows has an equivalent system called Task Scheduler. Calling cron.php at regular intervals will allow, amongst others, the indexation of content the content and to check for updates.

Setting up a cron job under a *nix system is fairly easy.

  1. Create or edit a crontab by typing in a terminal crontab -e
  2. Assuming that you have one of the following programs on your system, add one of the following line to trigger a request to cron.php every hour:
    • 0 * * * * /usr/bin/wget -O - -q -t 1 http://example.com/cron.php
    • 0 * * * *  /usr/bin/lynx -source http://example.com/cron.php
    • 0 * * * * curl --silent --compressed http://example.com/cron.php
  3. Save and exit your editor.

Setting up cron jobs on Windows is almost as easy! See Resources below.

Drupal logs information about cron jobs. Once you have configured it, you should see entries in your logs (Administer > Reports > Status report and Administer > Reports > Recent log entries) indicating the status of the related tasks.

fp

If you are working with a code repository (like svn, git, etc.) you might have found it useful to set up a cron job that regularly runs a script that in turn triggers the update of your code on the server. While this is nice while developing it may be disastrous in production environment!

Make sure to disable any automated update of your code before going live.

fp