Setting up a Scheduled Task in Linux

From Cerberus Helpdesk Wiki

Jump to: navigation, search

Open your crontab (crontab -e at the shell, or using your Control Panel software) and add an entry using:

*/5 * * * * wget -O - -q http://www.your-website/cerb4/cron 2>&1 > /dev/null

Or, if you're not using URL rewriting, use:

*/5 * * * * wget -O - -q http://www.your-website/cerb4/index.php/cron 2>&1 > /dev/null

Be sure to set the full path of wget (for example: /usr/bin/wget). You will get the path by typing

which wget

Include this into your cronjob.

  • The */5 means Run Every 5 Minutes.
  • If you don't have wget installed on your server you can use lynx, cURL, a PERL script, netcat or any other program capable of requesting the /cron URL from your server. At the worst, you can even set up a scheduled task on your desktop machine to "ping" the URL on your server every 5 minutes -- or you can use the internal timer option in Cerberus.
  • Note that Scheduled Jobs will not run more frequently then every 5 min's with these settings. If you want to run it every min. User the line below.
* * * * * wget -O - -q http://www.your-website/cerb4/index.php/cron 2>&1 > /dev/null
  • Be sure that under "Helpdesk Config -> General Settings -> Security" the IP of the cron-machine (usually 127.0.0.1) is added. To be super sure, add "127.0.".

[edit] Optional: Installing wget from source

  1. Visit gnu.org
  2. Download the latest release of wget.
  3. Extract the archive into a new directory. 'cd' to the new directory.
  4. Run ./configure
  5. Run make
  6. Run make install

The wget command should now be on your path. You can now follow the instructions at the top of this page.

[edit] Optional: Installing wget from RPM

  1. Visit rpmfind.net
  2. Download the latest wget RRM for your platform.
  3. Run rpm -i filename.rpm (or the equivalent command for your platform).
Personal tools