How would you guys read the following crontab schedule?

0 8 1-7 * 0

I read it as 8am first Sunday of the month. Right?

I had this run custom schedule for a patch deploy and for some reason it ran at 8am today (Thursday). Am I missing something? I'm curious to know why it ran today and not Sunday.


EDIT: Update. I just wanted to be sure I was not crazy and created a detect and deploy schedule to run on a couple of test workstations. I used 30 9 1-7 * 0 for the run custom patch schedule. At 9:30 today it started running on my two test workstations.

Again, am I reading it wrong? First number is the minutes, second is the hour, third is the day of the month, fourth is the month and last is the day of the week (0=sunday).
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Looks good...

Dumb question but is your date / time right on the kbox?
Answered 06/02/2011 by: dchristian
Red Belt

Please log in to comment
Yep. That was the first thing I checked.
Answered 06/02/2011 by: clementa
Senior Yellow Belt

Please log in to comment
I think this is how crontab is supposed to normally work, but for some reason the K1 does not treat it that way. K1 will run it at 8am every day between the 1st and 7th, and every Sunday. Basically cumulative rather than exclusive.

I tried the same thing, and ran into the same problem, because we want to run patching in relation to the date of MS Patch Tuesday. (Example: Patch a QA group on the Thursday after Patch Tuesday, then patch everyone on the next Thursday.) Unfortunately my work-around is to manually change the schedule every month, which stinks. I would love it if it could work this way.
Answered 06/06/2011 by: TJSmithCIQ
Orange Belt

Please log in to comment
In crontab you should specify a day of week OR a day of month but not both.

0 8 1-7 * 0
What you wrote actually means, 0800h on the 1-7 days of the month for any month and every sunday

What you want is not possible, but let's say you wanted the first day of the month at 8am then you should write:
0 8 1 * ?

The ? negates that option.
Answered 06/06/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
So there is no way to run a custom schedule for what I want (first saturday, second sunday etc..)?

With the number of workstations I have I'd like to schedule patch deploys on the weekend and on different weekends at that during the month. I know I can pick a day of the week but having 30K+ workstations patching every single weekend would be a bit much don't you think?

I could spread it out during the week at night but we shut down almost all our workstations to conserve power.

Answered 06/22/2011 by: clementa
Senior Yellow Belt

Please log in to comment
It is possible if you are willing to do what my post here says:

Basically for patching this would mean:
  1. setup your patch schedule to run every day
  2. setup your patch schedule to target a machine label "Machines for 1st saturday of month
  3. setup a second machine label that looks at "Machines for 1st Saturday of month" and adds a time component

select ID from MACHINE JOIN
L.NAME='Machines for 1st Saturday of month'
/*********** adjust this for each sched *************/
/*first saturday of month*/

This patch schedule would have no machine's to work on unless it is the first saturday of the month.
Answered 06/22/2011 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
Thanks. I'll give it a try and report back.
Answered 06/28/2011 by: clementa
Senior Yellow Belt

Please log in to comment

DELL, what a boneheaded mistake to not give the user this option. WHAT WERE YOU THINKING!!!!!???

Answered 01/31/2013 by: climberbry
White Belt

Please log in to comment