Video Screencast Help
Scheduled Maintenance: Symantec Connect is scheduled to be down Saturday, April 19 from 10am to 2pm Pacific Standard Time (GMT: 5pm to 9pm) for server migration and upgrade.
Please accept our apologies in advance for any inconvenience this might cause.

Script for chaining jobs in BE 2012

Created: 01 Jun 2012 • Updated: 13 Jun 2012 | 2 comments
pkh's picture
+1 1 Vote
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 2 CommentsJump to latest comment

King_Julien's picture

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

A second of your life, ruined for life.

-2
Login to vote
Hellsmk2's picture

This script falls a little short of what I need - it doesn't suspend the job after it has run.

This means I have to manually place each job back on hold every day - which is a nightmare with 100+ servers.

I've tried adding the Suspend-BEJob switch in various plaes without any luck - any chance you could help? I'm trying to avoid having to add a post command in every job, as it will be a nightmare to do, and the PS route is already confusing enough for the admins who will be looking after this.

Cheers

-3
Login to vote