Job will fail by its own with exit code 196 - which stands for
client backup was not attempted because backup window closed
A backup or an archive operation that the backup scheduler queued was not tried because the backup window was
no longer open.
This isn't possible. Queued jobs will cancel but active jobs will continue to run.
If you want to do something like cancel active jobs you'll need to script it.
Sorry - Not possible. There is no out of the box function to cancel active backup still running when backup windows closes. You can however easy write a script that does this.
SLP can be set to "auto cancel" when SLP windows closes.
Thank for your reply.
I very surprise if NetBackup cannot do this.
Hope Veritas will include this feature in the next release.
I disagree. I've been using NetBackup for years... and I'm really glad that backups that overrun don't get, and cannot be, cancelled. It's a life safer. The idea of cancelling a running backup at exactly the moment the scheduling run window closes looks like a logically sound idea, but is actually unsuitable in practice for most businesses.
If you are new to the actual working practicalities of backups then you are more than welcome to script it yourself. For any OS, it should only take one or two commands to schedule a daily job containing this one command:
# bpdbjobs -cancel_all
Personally I wouldn't recommend it myself, but then maybe your business and site requirements are somewhat non-typical.
I agree with @sdo
A cancelled backup is unusable, putting your client at risk.
Please bear in mind that the window in a policy schedule is a START window.
Not the period during which a backup must start and end.
Because this a START window, you select the period during which you will allow the backup to start. If a backup goes active 1 minute before the window closes, it will continue running until completion.
This is by design and cannot be changed.
So, carefully look at your scheduling - ensure the backups start early enough to ensure backups are done by the time when you no longer want backups to run.
I agree with everyone, especially sdo who makes excellent points.
Consider this ... your backups are running, just nearing the end with a few minutes to go, the backup window closes and then bang, they are all cancelled, when for just a few minutes more, they would would have all completed.
Not such a good idea ...
Perhpas you could explain why you wish to do this, then perhaps we can suggest alternative wasys of resoling the issue, because cancelling them in this manner really really is not recommended.
I am on solaris, so everything is scripted and aliased, which makes my life easier. In the past, I had issues where duplications would queue up, and as the started they would reserve drives, only to find that a media was in use, AND WOULD THUS HOLD THE RESERVED DRIVE! I would end up with tons of jobs that could have processed, stuck waiting for a source tape to unload.
I created a script called find.n.kill, that would search the bpdbjobs for these and inactive and cancel and delete them.
Worked like a champ.
for i in `/usr/openv/netbackup/bin/admincmd/bpdbjobs -report -most_columns | /usr/bin/grep SLP| /usr /bin/grep -i " media is in use "| /usr/bin/grep ",,," | cut -f 1 -d","`
echo "Now cancelling and deleting: "$i
/usr/openv/netbackup/bin/admincmd/bpdbjobs -cancel $i
/usr/openv/netbackup/bin/admincmd/bpdbjobs -delete $i
If you do something like this MAKE SURE it will ONLY KILL the one you want. Put the backup in a specific policy or identify it in a special way, because it will be a "resume generating event" if you do "-cancel_all"