cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic cancel NetBackup job

Wittaya_BizCon
Level 2
Partner Accredited

Hi,

I would like configure NetBackup to automatic cancel job when the backup windows is end.

Which option on NetBackup that I have to setup for this requirment?

Thank you. 

8 REPLIES 8

quebek
Moderator
Moderator
   VIP    Certified

Hello

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.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

hi,

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.

Nicolai
Moderator
Moderator
Partner    VIP   

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.

Wittaya_BizCon
Level 2
Partner Accredited

Hi RiaanBadenhorst,

Thank for your reply.

I very surprise if NetBackup cannot do this.

Hope Veritas will include this feature in the next release.

 

sdo
Moderator
Moderator
Partner    VIP    Certified

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.

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

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.

mph999
Level 6
Employee Accredited

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.

 

Genericus
Moderator
Moderator
   VIP   

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","`
do
echo "Now cancelling and deleting: "$i
/usr/openv/netbackup/bin/admincmd/bpdbjobs -cancel $i 
sleep 5
/usr/openv/netbackup/bin/admincmd/bpdbjobs -delete $i
done

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"

 

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS