Community Documentation

Solution using Drush and crontab and without wget

Last updated March 7, 2013. Created by bvanmeurs on September 29, 2011.
Edited by 2020media, eiriksm. Log in to edit this page.

The other solutions listed are still soft crons: a long task could be broken by an Apache timeout.

Use Drush for this. Create a crontab by logging in as the correct Linux user and typing in the shell 'crontab -e' and enter the following:

MAILTO="log@yourdomain.com"
0 * * * * cd ~/www/; drush @sites core-cron --yes

Notice that you may change the 'cd ~/www/' to your home folder. The current cron settings is 'once per start of an hour'. If you want to change this, look for a tutorial on crontab settings.

Notice that Drush executes via the CLI PHP so those php.ini settings apply. Imo, this is an advantage rather than a disadvantage as you can specify the cron to use more memory if necessary.

You can also use the --root option so you don't need to cd into the directory for each time.

0 * * * * drush --root=/home/user/www @sites core-cron --yes

Comments

With drush aliases configured it's like this

With drush aliases configured it's like this:

MAILTO="log@yourdomain.com"
0 * * * * drush @ALIASNAME -l MULTISITEURL core-cron

Be sure to create a symbolic link in /bin to drush such as:

sudo ln -s /usr/local/php5/bin/drush /bin/drush

The location of drush and sh may vary.

nobody click here