Today I’m going to talk about the Task Scheduler, recurrence, and the alternative options available to BatchPatch users needing to create tasks that execute more than just one time.
Let’s start with the standard recurrence options available in the Task Scheduler options.
Scheduled Tasks with Standard Recurrence (Daily, Weekly, Monthly)
- To create a standard recurring scheduled task, highlight the desired rows/hosts in the BatchPatch grid, and then select ‘Actions > Task scheduler > Create/modify scheduled task.’
- In the window that appears you must select the desired task to be executed from the Task drop-down list. Then set the reference time. NOTE: When you modify the reference time, the run time automatically changes accordingly. For all scheduled tasks that have no recurrence option set, the run time will be the same as the reference time. Also when any standard recurrence option is set (daily, weekly, monthly), the run time will be the same as the reference time. However, when you create a recurring task with one of the recurrence options that says “+ X days” you’ll see that the reference time and the run time will differ by the X value, in days. We’ll get into more detail with that option later on in this posting.
- Finally, choose your recurrence option – daily, weekly, or monthly. Then click OK to apply the scheduled task to the highlighted rows. Make sure the scheduler is running/enabled, by clicking the clock icon in the upper right corner of the BatchPatch window. When it’s green the scheduler is running/enabled.
Scheduled Tasks with Advanced Recurrence (+ X days)
When it comes to Windows Updates, as patching administrators we all know that Microsoft generally releases updates on the 2nd Tuesday of each month. This day has become known as “Patch Tuesday.” Wouldn’t it be convenient if you could just set a schedule to automatically download and install updates at some time/day that is always X days after Patch Tuesday?
While we do not recommend installing Windows Updates *immediately* after Patch Tuesday, we *do* recommend installing the updates within a couple of weeks of Patch Tuesday. The idea here is all about mitigating risk. There is a real risk involved in installing updates, particularly on production servers, *immediately* after they are released. This is because Windows updates can and sometimes do actually break things. On the flip side, if you wait months to install updates, you leave your machines exposed to vulnerabilities that would be fixed by applying the updates in question. We tend to think the sweet spot for installing updates is usually some time between 4 days and 2 weeks after the updates have been released by Microsoft. This gives ample time for those updates to be tested in your lab instead of in your production environment, and it also gives time for other people around the world to report any issues that they encounter, while still getting the updates applied somewhat soon after they are initially released, thereby protecting your machines from being exposed for any longer than necessary.
So, let’s say your scheduled maintenance window occurs on the first Saturday after Patch Tuesday. While Patch Tuesday is always the 2nd Tuesday of the month, the Saturday that comes after is not necessarily the 2nd Saturday of the month. For example, in the current month (March 2018) the Saturday that comes after the 2nd Tuesday of the month is actually the 3rd Saturday of the month. So if we want to reliably have a scheduled task that always recurs on the Saturday that comes after the 2nd Tuesday, we need to be able to schedule it for “Monthly (2nd Tuesday) + 4 days.” If we instead scheduled it for every 2nd Saturday, we’d encounter many months where we’d end up running the task on the Saturday *before* instead of the Saturday *after* Patch Tuesday. This would obviously be unacceptable. Hence why the BatchPatch recurrence options include functionality for ‘Monthly recurrence + X days’. When you select this option from the ‘Recurrence’ drop-down menu in the BatchPatch Task Scheduler, you’ll notice that the run time is no longer the same as the reference time. The reference time gets set to the actual 2nd Tuesday of the month, while the run time is set to the following Saturday. In each month no matter which day the 2nd Tuesday lands on, with this setting your scheduled task will always end up recurring on the 1st Saturday following the 2nd Tuesday. Pretty cool, right?
Scheduled Tasks with Multiple Tasks Scheduler
If for any reason the recurrence options do not suit your needs or desires, you may always just use the ‘Multiple Tasks Scheduler.’ This feature enables you to set a specific task to run at specific days/times for a given host. For this you would just click the button ‘Create Multiple Scheduled Tasks‘ and then set your desired tasks accordingly. In the screenshot below you can see that I have 3 different run dates and times set for a task. I could populate as many different run dates and times as I want, effectively allowing full customization of the schedule.
Scheduled Tasks with Multiple Rows Per Host in the Grid
The other option that’s always available instead of using the built-in recurrence options and instead of using the built-in ‘Multiple Tasks Scheduler’ is to simply populate the grid with multiple rows for each host. So if you want to set 3 different scheduled tasks for a given host, you can add that host to the grid 3 times. Then in each row you could create a different scheduled tasks, as illustrated in the screenshot below.