Run a cron on all sites in a mutlisite

This is a mini-HOWTO explaining how you can create a simple cron system to run the cron of each site in a multisite environment.

First of all, you need a copy of sympal_scripts. You will be using only a tiny part of them, but grabbing the whole packackage is the simplest, by far.

Make sure you install them outside your web-root!

$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib 
checkout contributions/modules/sympal_scripts

Or grab and extract the tarball

Now browse to your newly extracted files. For example: ~/sympal_scripts/

There you invoke the command:

php ./cron.php --all --drupal_dir /var/www/drupal/

Make sure that /var/www/drupal/ is the location of your Drupal multisite installation.

Optionally add the following to your crontab:

*/16 * * * * php /home/XYZ/sympal_scripts/cron.php --all --drupal_dir /var/www/live/ >> /dev/null 2>&1

wich will run a cron on all the sites in your multisite installation on /var/www/live/ every 16 minutes (sixteen is chosen to avoid peeks on the whole hours).