Here's a script that will cancel unfinished backup jobs for specific clients. Tested using NetBackup Server v7.6.1.2 on Windows 2012 R2, but it should work for your version too.
Amend the required lines to match client names, and created a scheduled task to run it.
@echo off
setlocal enabledelayedexpansion
set z_path=%~dp0
set z_name=%~n0
set z_file_job=!z_path!!z_name!.job
set z_file_log=!z_path!!z_name!.log
set z_file_tmp=!z_path!!z_name!.tmp
if exist "!z_file_job!" del "!z_file_job!"
if exist "!z_file_tmp!" del "!z_file_tmp!"
call :log ""
call :log "************************************************"
call :log "Script started..."
call :log ""
call :log "Determining NetBackup installation path..."
reg query "HKLM\Software\Veritas\NetBackup\CurrentVersion" /v "InstallDir" >"!z_file_tmp!" 2>&1
set z_sts=!errorlevel!
if not !z_sts!==0 (
call :log "...failed to determine install directory for NetBackup, status `!z_sts!`, script aborting..."
goto :end
)
for /f "tokens=1,2,* skip=1" %%a in ('type "!z_file_tmp!"') do (
set z_installdir=%%c
)
call :log "...NetBackup installation path is: !z_installdir!"
call :log "...done..."
set z_bpdbjobs=!z_installdir!NetBackup\bin\admincmd\bpdbjobs.exe
call :log ""
call :log "Listing activity monitor jobs..."
"!z_bpdbjobs!" -most_columns -file "!z_file_job!" >nul 2>&1
set z_sts=!errorlevel!
if not !z_sts!==0 (
call :log "...failed to retrieve jobs, status `!z_sts!`, script aborting..."
goto :end
)
call :log "...done..."
call :log ""
call :log "Processing list of jobs..."
set /a z_job_records=0
set /a z_backups_unfinished=0
set /a z_backups_cancelled=0
for /f "tokens=1,2,3,4,5,6,7,8,9,10 delims=," %%a in ('type "!z_file_job!"') do (
set z_job_jobid=%%a
set z_job_type=%%b
set z_job_state=%%c
set z_job_client=%%f
set /a z_job_records+=1
set z_cancel=N
if not "!z_job_state!"=="3" (
if "!z_job_type!"=="0" (
set /a z_backups_unfinished+=1
call :log "...found job `!z_job_jobid!` is an unfinished backup for client `!z_job_client!`..."
REM **** add more lines just here for more clients to cancel...
if /i "!z_job_client!"=="my-long-client-name.at-my-domain.zzz" set z_cancel=Y
if /i "!z_job_client!"=="client01" set z_cancel=Y
)
)
if /i "!z_cancel!"=="y" (
call :log "......cancelling job..."
"!z_bpdbjobs!" -cancel !z_job_jobid! >>"!z_file_log!" 2>&1
set z_sts=!errorlevel!
if !z_sts!==0 (
call :log "......job cancelled ok..."
set /a z_backups_cancelled+=1
) else (
call :log "......failed to cancel job, status `!z_sts!`, script continuing..."
)
)
)
call :log "...done..."
call :log ""
call :log "Totals..."
call :log "...job records found: !z_job_records!"
call :log "...backups unfinished: !z_backups_unfinished!"
call :log "...backups cancelled: !z_backups_cancelled!"
call :log "...done..."
:end
call :log ""
call :log "Script exiting..."
exit /b
:log
(echo !date! !time:~0,8! %~1)
(echo !date! !time:~0,8! %~1)>>"!z_file_log!"
goto :eof