Basics – Perpetual overrides in schedules

In the dim dark days of NetWorker (e.g., v4 and v5), I used to have periodic cron jobs that would fire off on my local workstation – these would send me snappy messages, once every 3-6 months, along the lines of:

“Right you, time to update all the overrides in all the Daily/Monthly schedules!”

Of course, this referred to wanting to run backups which say, had a monthly full on the last Friday of the month, and therefore skipped the daily backup on the final Friday of the month. NetWorker didn’t really support this other than to sit in the schedule configuration and one at a time, set the required date for the end of each month to a Full or Skip depending on the schedule.

To say that it was tedious was a bit of an understatement.

Thankfully, in version 6 of NetWorker, a “bug” was introduced that sort of allowed this to be perpetually set; in v7 however, setting overrides perpetually became more readily available. Now, to me, it’s one of the most useful options that you can have within NetWorker’s schedules. I’ll show you how it works using the example above.

First, let’s create our Daily schedule; it will initially look like this:

Classic "Daily" Schedule

Now, in the old days (and using the old, hideous GUIs), if you wanted to set the last Friday of the month to skip, you’d have to do this for the last Friday of each month for as long as you were prepared to scan through:

Classic method for setting skip on final Friday of the month
Classic method for setting skip on final Friday of the month

As you can imagine, this would get very tedious, very quickly. Yes, you could script it using nsradmin, but quite frankly, at the time that I wanted to do this, I was a lazy scripter and hated working with dates. These days I’m a less lazy scripter, but I still try to avoid working with dates wherever possible.

That being said, there’s now a much easier way, and you do it by modifying the schedule view to turn off the calendar functionality. While that functionality is good for day to day browsing, it does obstruct some more powerful usage of the schedule system. To do so, right-click on the Daily schedule within the schedule list:

Turning off calendar view for schedules
Turning off calendar view for schedules

Now, with that turned off, edit the Daily policy again – instead of coming up as a calendar, you’ll instead see:

Non-calendar view of Daily Schedule
Non-calendar view of Daily Schedule

In order to set a perpetual override, all we have to do is update the “Override” field with the following string:

skip last friday every month

Which will look like the following:

Setting the perpetual override for the Daily schedule
Setting the perpetual override for the Daily schedule

When we revert back to calendar view, we can then see the skip applied not only for the current month, but every month selected moving forward:

Daily schedule showing perpetual override
Daily schedule showing perpetual override

Now, here’s another trick by turning off calendar view. It’s easier to create monthly schedules. Remember the “action” field in the non-calendar view? That’s basically a list of levels, one per day, for the type of schedule we create – either daily or monthly. When it’s a daily schedule, it’s a list that starts on Sunday and finishes on Saturday. When it’s a monthly schedule, it starts on the first, and finishes on the thirty-first – any days that don’t exist in a month (e.g., the twenty-ninth through to the thirty-first in any regular February) are just ignored.

The trick to lazy schedule creation is knowing that if the list is shorter than the number of days specified by the schedule type, NetWorker will just loop the list again and again until it’s got the right number of entries. The net result of this is: you can create the Monthly schedule much quicker. Instead of either creating it as a Monthly schedule with “skip” set for every day of the month, or a Daily schedule with “skip” set for every day of the week, you can instead just do this:

Monthly schedule creation (non-calendar view)
Monthly schedule creation (non-calendar view)

When viewing this schedule as a calendar again, we can see that it works exactly as we want:

Perpetual monthly schedule in calendar view
Perpetual monthly schedule in calendar view

It couldn’t be easier or simpler!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.