How to Schedule a Job in Unix

The cron clock daemon enables the UNIX system administrator to schedule tasks for automatic execution at any time of the day or night. Cron is started at boot time, and reviews its schedule at one-minute intervals around the clock. When the appointed hour for a job is reached, the task is spawned and runs separate from cron, and without operator intervention. When the task is completed, the job and shell in which it operates are killed.

Instructions

    • 1

      Type the following command to edit your cron table:

      crontab --e

      Most UNIX installations will start the vi text editor, but yours may be configured to use an alternate tool.

    • 2

      Add the time and task to the cron table. For example, if you want to run the task MyJob every night at 1:15 a.m., an entry is added to the table similar to the following:

      15 1 * * * /home/myUser/MyJob.pl

      The entry reads from left to right, specifying the time and job to execute.

      15 Minute

      1 Hour

      * Day = everyday

      * Month = every month

      * Day of Week

    • 3

      Close vi (or the alternate text editor) to save the cron table and submit it to the daemon.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured