cancel
Showing results for 
Search instead for 
Did you mean: 

canceling all jobs from command line

Richard_Via
Level 2
We are trying to configure our UPS systems to shut down servers and I was wondering if there was a switch for bemcmd.exe to cancel all running jobs in the event of a power failure. This would hopefully be part of a batch file. Thanks.
7 REPLIES 7

Shraddha_Dhaval
Level 6
Hi Richard,

To cancel jobs from the command line:
Use the command line bpdbjobs command from the following path:

/usr/openv/netbackup/bin/admincmd

* To cancel a single job_id enter the following commands:

bpdbjobs -cancel job_id -- the job_id number is listed in the activity monitors display

Here is an example of the command line canceling of job_id 11328:
bpdbjobs -cancel 11328

* To cancel multiple job_id enter the following command:

bpdbjobs -cancel job_id, job_id, job_id -- The job_id is listed in the activity monitors display.

Here is an example of canceling multiple jobs 11328, 11329, 11330 from the command line:
bpdbjobs -cancel 11328,11329,11330 -- It is necessary to separate each job_id with a comma.


Please revert if we have not understood or answered your question.

Thanks.


Note : If we do not receive your reply within two business days, this post would be marked ?assumed answered? and would be moved to ?answered questions? pool.

Ken_Putnam
Level 6
Have no idea why the Symantec tech told you to use a Netbackup utility with BackupExec, but -

You should be able to script up something with BEMCMD using the -011 to get job ids and -020 to cancel the jobs

ray_littlefie1
Level 6
..sounds too complicated to me, you would need to modify the script each time you added/removed a backup job.

wouldn't a few 'net stop' commands against the Backup Exec services (device, engine & server) do the same thing with less hassle?

Stumpr2
Level 6
The Netbackup thingee....

Newer versions of Netbackup allow you to suspend an active job and resume from the last checkpoint instead of starting all over.

But I would probably just do a
# netbackup stop

Gauri_Ketkar
Level 6
Hi,

We apologize for the inconvenience caused because of the delayed response. Pleases let us know if your issue / problem is resolved so that we can archive this post.


However, if the issues still persist then refer to the steps mentioned below :


VERITAS Backup Exec (tm) 10.0 for Windows Servers and Symantec Backup Exec (tm) 10d for Windows Servers Command Line Utility Guide
http://support.veritas.com/docs/275538


Update us on the same and revert for any further Query
Hope this will help you


Thank you
Gauri


NOTE : If we do not receive your reply within two business days, this post would be marked "assumed answered" and would be moved to "answered questions" pool.

sten_satterberg
Not applicable
Hello Richard,

Not sure if you're still working on this or not, but I've just come up with a batch file which does the trick. We were also in need of a batch file which would cancel all active jobs when triggered by a UPS shutdown. Going off a suggestion from Ken Putnam I created the following batch file which dumps the active job ID's and then cancels them one-by-one.

Since bemcmd.exe usually resides in the "Program Files" directory I've set it up to be run from within that directory.

### begin CancelActiveJobs.bat ###
cd /d C:\PROGRA~1\VERITAS\BACKUP~1\NT\
bemcmd -o11 -i > C:\PROGRA~1\VERITAS\BACKUP~1\NT\current.txt
FOR /F "tokens=3,4 delims= " %%B IN ('findstr /i "job" C:\PROGRA~1\VERITAS\BACKUP~1\NT\current.txt') DO bemcmd -o20 -i%%B
### end of batch file ###

line 1 - change directory to the Backup Exec "Program Files" directory
line 2 - dump Job ID's using bemcmd.exe to a temporary .txt file
line 3 - for all lines containing the word "JOB", extract the job ID from the .txt file and then issue the cancel command with bemcmd.exe for each instance found

In spite of what was written previously it's completely independent of jobs which you create, so there's no need to modify it each time you add/move/change a backup job.

Hope this helps. Cheers!
Sten

Most of the time when trying to cancel an active backup job, the status shows as "Cancel Pending" for a long period of time and may look like to be hung.

Solution:
========
Need to restart all Backup Exec services, this method will cancel ALL jobs that are running.
STEPS:
======
Follow the article (https://www.veritas.com/support/en_US/article.TECH87507)

In the Backup Exec Console-:

1. Click on "Tools"  “Backup Exec Services" to open the servicesmgr.exe.
2. Click on "Restart all services" (In most cases, this process will get to the bengine service and appear hung).
3. Open Windows task manager and click on the "Processes" tab.
4. Enable "Show Processes from all users".
5. Click on the "Image Name" column to sort alphabetically.
6. Locate and highlight the following services.

• Pvlsvr.exe  (Backup  Exec device and media service).
• Bengine.exe  (Backup Exec job engine service).
• Beremote.exe  (Backup Exec Remote Agent for Windows Server service).

7.Right Click on the above services in order and click on "End Process Tree" to terminate this process.
8.Close the task manager and return to the services manager.