Unix provides a service called cron that runs programs repeatedly on a fixed schedule. Most experienced administrators consider cron to be vital to the system because it can perform automatic system maintenance.

For example, cron runs log file rotation utilities. You should know about cron not only in the interest of knowing about everything that runs on your system, but also because it is just plain useful.

You can run any program you like with cron, choosing the times that suit you. A program running through cron is called a cron job. To install a cron job, you need to create an entry line in your crontab file, usually with the crontab command. Here is a typical crontab file entry that runs a command daily at 9:15 AM:

15 09 * * * /home/juser/bin/test

The five whitespace-delimited fields at the beginning specify the schedule time :

•Minute (0–59)
•Hour (0–23)
•Day of month (1–31)
•Month (1–12)
•Day of week (0–7; 0 and 7 are Sunday)

Leave a Reply

Your email address will not be published. Required fields are marked *