Forum Discussion

NK-'s avatar
Level 2
7 years ago

Script to suspend jobs for multiple servers

*** Moved to new post from:  ***

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



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


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


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

objFile.Write strContents


2 Replies

  • 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.