How to configure cron
First make sure cron is properly configured. Check /usr/lib/cron/cron.allow and /usr/lib/cron/cron.deny.
In Ubuntu none will exist by default so if you want to allow everybody to run cron then
# cd /usr/lib # mkdir cron # touch cron.deny
This creates and empty cron.deny allowing all users to run cron.
To edit a crontab through the command line, type:
# crontab -e
Add a line for you site replacing example.com with the name of your site
45 * * * * /usr/bin/wget -O - -q -t 1 http://www.example.com/cron.php
References: Configuring cron jobs - Crontab - Quick reference
On Windows use wget for Windows and set up a task in the Windows Scheduler. In a multisite installation create a batch file like this:
"C:\Program Files\GnuWin32\bin\wget.exe" -q -O nul http://www.site1.com/cron.php "C:\Program Files\GnuWin32\bin\wget.exe" -q -O nul http://www.site2.com/cron.php "C:\Program Files\GnuWin32\bin\wget.exe" -q -O nul http://www.site3.com/cron.php
To avoid to annoying command window that pops up when the task runs and you are logged in, set the job to run as NT AUTHORITY\SYSTEM -- leave the password fields blank when prompted and click OK.
- Login to post comments