Video Screencast Help
Search Video Help Close Back
to help

Script for chaining jobs in BE 2012

Created: 01 Jun 2012 | Updated: 13 Jun 2012 | 1 comment
pkh's picture
0 0 Votes
Login to vote

This BEMCLI script is a follow-up to my article

https://www-secure.symantec.com/connect/articles/u...

This script makes it easier to set up the jobs that you want to run in sequence.

1) Get the list of jobs

You can get the list of jobs that you want to run by running this cmdlet and pipe it to a text file

Get-BEJob | select-object name > jobs.txt

If you want to get only a certain type of job, you can use the parameters of the Get-BEJob cmdlet to do so.  For example,

Get-BEJob -Jobtype Duplicate 

will get you all the duplicate jobs

and

Get-BEJob -Status Missed

will get you the list of of missed jobs.

2) Arrange the job in sequence

Edit the text file with the job names and arrange the jobs in the sequence that you want to run them.  The content of the text file should look something like this

 

Server-1 Backup 00021-Backup                               
Server-3 Backup 00014-Backup                                            
Server-1 Backup 00003-Backup                                            
Server-2 Backup 00008-Backup                                            
Server-1 Backup 00006-Backup                                            

3) Execute the script from the command line or as a pre-/post-command of a job.

Chain-BEJobs "\jobs.txt" "\results.htm"

The first parameter is a file containing the list of jos and the second optional parameter is the file which will contain the results of the jobs.  If the second parameter is omitted, then no result will be output.  You can supply the full path for both files.

 

To prepare your environment to run BEMCLI, you might want to read my article

https://www-secure.symantec.com/connect/articles/p...

 

Comments 1 CommentJump to latest comment

King_Julien's picture

I'll try it this weekend. Hope it works! 

A second of your life, ruined for life.

0
Login to vote