Categorized | News

Scheduling Jobs (Crontab)

Posted on 03 July 2001 by Demian Turner

Setting up a job to occur automatically on a regular basis (a cron job) is an immensely useful facility. This is stanard on UNIX-based systems and easy once you know the basics.

Here are a few example crontab entries:
0 2 * * * /home/redcurry/bin/rdf_grabber >& /dev/null
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/mrtg /usr/ins/intel/gui/bin/mrtg-cpu.cfg >& /dev/null

Just to translate into English, the first job fires off a script called ‘rdf_grabber’ everynight at 2 am.

The second entry fires off the app ‘mrtg’ using the config file mrtg-cpu.cfg every 5 minutes, 24 hours a day, 7 days a week.

The >& /dev/null bit at the end just takes care of any potential output that might result in case of an error and saves the sysadmin being bombarded by emails.

Bookmark and Share

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up