cancel
Showing results for 
Search instead for 
Did you mean: 

Script to suspend jobs for multiple servers

NK-
Level 2

*** Moved to new post from:  https://vox.veritas.com/t5/NetBackup/Script-Command-that-will-suspend-all-Active-jobs-for-Client-7/m...  ***

Anyone know of a script or command that exists that would  to suspend all active jobs for Netbackup client & resume after activity.

 

Below script for one server at a time, I want for script for multiple servers

 

suspend.bat:

del /Q c:\suspendjobs\runningjobs.txt
 
bpdbjobs -report -all_columns -ignore_parent_jobs> c:\suspendjobs\alljobs.txt
 
c:\suspendjobs\check.vbs
 
for /f %%a in (c:\suspendjobs\runningjobs.txt) do bpdbjobs -suspend %%a -quiet

check.vbs:

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\suspendjobs\alljobs.txt", ForReading)


Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine
    arrFields = Split(strLine,",")

    If InStr(arrFields(6), "server1") And InStr(arrFields(3), "")<=0 Then
        strContents = strContents & arrFields(0) & vbCrlf
    End If
Loop

objFile.Close


Set objFile = objFSO.CreateTextFile("c:\suspendjobs\runningjobs.txt")
objFile.Write strContentsa

objFile.Write strContents


objFile.Close

2 REPLIES 2

Alexis_Jeldrez
Level 6
Partner    VIP    Accredited Certified

I'd like to how in what context are the jobs being suspended.

As a general rule, when I need everything stopped:

  1. Suspend the SLP secondary operations.
  2. Set to 0 the number of jobs the Storage Units can handle ("Maximun Concurrent Jobs" for Disks and "Maximun Concurrent write drives" for Robots).
  3. Stop the creation of new jobs by the master: "...\bin\admin\nbpemreq -suspend_scheduling". I believe this doesn't prevent User & Archive Backups jobs, though.
  4. Suspend every job that can be suspended. Naturally this only works with Policies with the "Take checkpoints every..." option.

 

Alexis_Jeldrez
Level 6
Partner    VIP    Accredited Certified