/build/static/layout/Breadcrumb_cap_w.png

Custom schedule for every 2nd Friday of every month?

I have this so far: 00 23 * * 5 and this is just every Friday at 11pm. Is it possible to make it every second Friday of every month at 11pm?


1 Comment   [ + ] Show comment
  • It seems like there would be a lot of IT departments interested in doing patching once per month after "patch Tuesday." That's exactly what my new boss wants, so I would be interested if anyone comes up with an exact solution for this. - Ultimation 11 years ago

Answers (3)

Posted by: Nico_K 11 years ago
Red Belt
2

not with the cron implementation of the KACE unfortunately.


Comments:
  • Some further detail: http://www.itninja.com/question/kace-cron-scheduling - jknox 11 years ago
Posted by: erik.ragan 11 years ago
Senior Yellow Belt
0

Best you can do would be to give it a date range, say, the 8th to the 14th. So something like...

0 23 8,9,10,11,12,13,14 * 5 (you might be able to do 8-14 too)

You can't actually build in the logic to run in the second Friday of the month using just the cron scheduling, intelligence like that would have to be builtin to the script you are running.

 

Posted by: darkhawktman 11 years ago
Green Belt
0

So here is how I have solved this for patching in my environment but you can do this for other parts of the Kbox too. You can use Help Desk Ticket rules to modify anything in the Kbox database.

Disclaimer: You would want to be very careful and probably test this in a test environment because you could accidently cause major problems with your database. Currently I'm running this in 5.4SP1.

First in your Patch Schedule set the "Run on the" setting. It doesn't matter what date you set here but make sure to put in every month and the time you want the patch to run.

You would want to create a custom ticket rule that runs Monthly and set the Next run date to the first of the month. It's very important that this runs on the 1st of every month to make this rule work. In the Select Query Section put this in:

select distinct IM_CRON.days_of_month, IM_CRON.ID,  PATCHLINK_SCHEDULE.DESCRIPTION, PATCHLINK_SCHEDULE.IM_CRON_ID
FROM IM_CRON, PATCHLINK_SCHEDULE
where PATCHLINK_SCHEDULE.DESCRIPTION
= 'PatchSchedule' and IM_CRON.ID = PATCHLINK_SCHEDULE.IM_CRON_ID;


Note: Replace PatchSchedule with a the name of your Patch Schedule.

Next click the check box for Run an update query, using the results from the one above

Now put this in for the Update Query:

update  IM_CRON set DAYS_OF_MONTH=14-dayofweek(curdate()) where IM_CRON.ID in (<TICKET_IDS>);


Now just save it and this should change your patch schedule every month to the second Friday.

Informational note: For some reason the Kron numbers for the days of the week is 0-6 where 0 starts on Saturday in the Kbox. I believe Kron is supposed to start on Sunday for 0 but the Kbox works differently from my testing.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ