Web Hosting Talk







View Full Version : Cron Job


Woody
06-22-2001, 01:28 AM
I have never used cron jobs before, but now I have to. :P Could someone please tell me how I would set a cronjob to run a perl script every 5 minutes.

Thanks.

Tim Greer
06-22-2001, 05:05 AM
Originally posted by Woody
I have never used cron jobs before, but now I have to. :P Could someone please tell me how I would set a cronjob to run a perl script every 5 minutes.

Thanks.

To list cron jobs, type:
crontab -l

To create or edit the crontab file, type:
crontab -e

To execute a command every 5 minutes, add this line:
*/5 * * * * command

The syntax is:

minute hour day month dayofweek command

So, type:

*/5 * * * * /path/to/script

Of course, you can pass a lot of things to it and run different commands, etc.