Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Using powershell to change mediaset

Created: 02 Jul 2013 | 2 comments

Hi,

I'm planning to have all scheduling jobs in my VTOM scheduler and try to make as few jobs as possible in Backupexec in order to hold them and run from VTOM.

i try to have the same duplicate on tape job for weekly,monthly and yearly full backup, i just need to change the mediaset.

for monthly i set the following script :

i export the list of jobs who are set to mediaset "Weekly_gold"

Get-BEJob | Where-Object {($_.storage -like "ROBOT*") -AND ($_.mediaset -eq "Weekly_Gold")} | Select-Object name,storage,mediaset > c:\scripts\output\jobs_robot_gold.txt

Then i parse this log to have valide backupdefinitions and duplicatestagebackuptask's name, for example MyServer as jobdefinition & Ontape for duplicate tesk and do the following :

Set-BEDuplicateStageBackupTask -backupdefinition "MyServer" -name "OnTape" -TapeStorageMediaSet "Monthly_Gold" | Save-BEBACKUPDEFINITION

the script works without error but change the media set for "keep data for 4 weeks" instead of the Monthly_Gold expected.

get-bemediaset will display Monthly_Gold correctly.

If someone have a clue ... :)

OS : windows 2008 SP2

Backup exec 2012 SP1

Operating Systems:

Comments 2 CommentsJump to latest comment

Colin Weaver's picture

Would be a lot easier to have separate duplicate stages for your weekly monthy weekly and yearly jobs that have the correct media sets predefined and then just release them from hold with BEMCLI

BTW due to to issues with duplicate jobs and catalog errors (0xe0009444) that can happen if you do not correctly run the duplicate jobs on the expected schedules, I would not even attempt scheduling outside of Backup Exec. It is hard enough to avoid these errors using the BE scheduler, if you run into them when externally scheduling  then you might be making a world of hurt for yourself (and not be able to get full support from Symantec either)

fbollier's picture

In fact i don't see how to schedule correctly monthly tape duplicate with the BE scheduler if saturday is 30th of the month and sunday 1st ,as my full backups runs on both sunday and saturday and i chain backup on disk & duplicate on tape.

I would like VTOM to change only the mediaset for the duplicate to tape job before the monthly/yearly job.

the chain/schedule is the same for weekly/monthly/yearly duplicate, just have to change the mediaset.

moreover it would avoid me to have over 300 new duplicate tasks ;)