Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crontab & Setting Up Jobs

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
I currently use the crontab to run three jobs every night.

They are set to run as:

00 21 * * * /location and job.
05 21 * * * /location and job.
15 21 * * * /location and job.


I need to modify these jobs to run every 60 minutes, with the exception of Sunday.

I also need to know if I could schedule these jobs to run every 60 minutes with the exception of Sunday between 0100 and 0700.

Help is much appreciated.
 
Another Quick Question:

Could I setup these jobs to run every 60 minutes between 0300 and 2200 every day?
 
Saweens,

Taking just the first line as an example, I think this will work for running the job every 60 minutes between 3 and 22 every day but Sunday. I'm not too clear now on when exactly you want the jobs to run.

0 1-22 * * 1-6 <command>

The cron fields are minute:hour:day of month:month of year:day of year:command.

So in the example above, the command is run at the top of the hour (0) from one a.m. (1) to 10 p.m. (22), every day of the month (*), every month of the year (*), but only if the day of the week is Monday through Saturday (1-6 -- Sunday is 0).

If these jobs are the same jobs, you could change the entry to be 0,5,15 1-22 * * 1-6 <command>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top