How to run a cron job?

I have a sample perl script which i need to run using cron daily ,could any one let me know the exact syntax to use cron job.

Thanks in advance.


To edit/view your crontab, type the following commands:

crontab -e # to edit
crontab -l # to view

Your cron job looks like as follows:

1 2 3 4 5 /path/to/command

Where 1 = minutes (0-59), 2 = hours (0-23), 3 = day (0-31), 4 = month (1-12), 5 = day of week (0-7).

For example, if I want to run something 5min after midnight, every day:

5 0 * * * /path/to/command 

You can also specify multiple values, separated by commas or hyphens, such as:

5,10 0-2 * * * /path/to/command 

which runs at 00:05, 00:10, 01:05, 01:10, 02:05 and 02:10 each day.


best link newbie http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/


Well, you should probably read man 1 crontab (for the usual command for interacting with your crontabs) and man 5 crontab (for the format they're written in) on your server. The syntax of cron jobs is extensive and flexible, and without some specific objective in mind we're just going to wind up summarizing the man pages.


man crontab