![]() But you may have a requirement of executing the command only during certain hours or vice versa. It executes the specified command check-disk-space every 10 minutes through out the year. */10 * * * * /home/maverick/check-disk-space Use the following, if you want to check the disk space every 10 minutes. 00 – 0th Minute (Top of the hour) 09-18 – 9 am, 10 am, 11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm * – Every day * – Every month 1-5 -Mon, Tue, Wed, Thu and Fri (Every Weekday)ħ.To schedule a background Cron job for every 10 minutes.Cron Job every weekday during working hours : This example checks the status of the database every weekday (i.e excluding Sat and Sun) during the working hours 9 a.m – 6 p.m.Ġ0 09-18 * * 1-5 /home/maverick/bin/check-db-status.00 – 0th Minute (Top of the hour) 09-18 – 9 am, 10 am, 11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm * – Every day * – Every month * – Every day of the week.Cron Job everyday during working hours : This example checks the status of the database everyday (including weekends) during the working hours 9 a.m – 6 p.mĠ0 09-18 * * * /home/maverick/bin/check-db-status.Only on Weekdays) If you wanted a job to be scheduled for every hour with in a specific range of time then use the following. 00 11, 16 * * * /home/maverick/bin/incremental-backupĠ0 – 0th Minute (Top of the hour) 11, 16 – 11 AM and 4 PM * – Every day * – Every month * – Every day of the week 6.To schedule a job for certain range of time (e.g. The comma separated value in a field specifies that the command needs to be executed in all the mentioned time. This example executes the specified incremental backup shell script (incremental-backup) at 11:00 and 16:00 on every day. Twice a Day) The following script take a incremental backup twice a day every day. 5.To schedule a job for more than one time (e.g. Thus the above convention can be used for all the other 4 fields. ![]() When you specify 0-10/2 in minute field mean every 2 minutes in the first 10 minute. When you specify */5 in minute field means every 5 minutes. More than using this * directly, you will find it very useful in the following cases. The * means all the possible unit - i.e every minute of every hour through out the year. But understanding this example will help you understand the other examples. Ideally you may not have a requirement to schedule a job every minute. 4.To schedule a job for every minute using Cron. By default this will edit the current logged-in users crontab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |