Disable Backup and Copy jobs so that Backup to Tape complete

PowerShell script exchange

Disable Backup and Copy jobs so that Backup to Tape complete

Veeam Logoby gmcoburn » Thu Jun 23, 2016 8:02 am

Hello All,

We have to back up some of our repositories to tape. We have multiple repository servers, of which one ends up holding copies of all of our backup data through the use of Backup Jobs (Reverse Incremental) and Backup Copy Jobs (Forward Incremental).

This server has 3 data drives, each assigned as a repository. These are not scale out repositories.

We currently have 3 separate Backup to Tape jobs whose backup source is the Repository, one for each repository drive, so that we may fit the backups within a reasonable time.

Due to the volume of data of data to be backed up to tape, the Backup to Tape process will not finish before new data is created on the repository by the Backup Copy or Backup jobs.

Currently we are manually disabling the Backup and Backup Copy jobs that target the repository in each respective job so that the backup to tape can complete without interruption. I would like to automate this process.

What I would like is 2 PowerShell scripts, one as a Pre-Job the other a Post-Job option in Veeam that;

1.Identifies the repository that is to be backed up
2.Identifies the Backup and Backup copy jobs on the repository and Disables them.
a.Extra Points – Identify if the jobs are running. If the jobs are running;
i.hold the start of the Backup to Tape job, waiting until the Backup or Backup Copy job finishes
ii.then disables the Backup or Backup job
iii.then allows the Backup to Tape job to start
3.After the Backup to Tape job is complete, re-enables Backup and Backup Copy jobs

I’ve had a bit of a muck around but frankly got stuck trying to identify jobs that used particular repositories.

Note that the source jobs data on the repositories can change, so hard coding job names is not appropriate.

Any and all help is appreciated.

Posts: 15
Liked: never
Joined: Thu Aug 28, 2014 5:23 am
Full Name: George Coburn

Re: Disable Backup and Copy jobs so that Backup to Tape comp

Veeam Logoby v.Eremin » Thu Jun 23, 2016 9:34 am

You can find jobs pointed to a particular repository, using the script provided below:

Code: Select all
Asnp VeeamPSSnapin
$BackupRepository = Get-VBRBackupRepository -Name "Name of your repository"
Get-VBRJob | where {$_.info.TargetRepositoryId -eq $BackupRepository.Id}

Hope this helps.
Veeam Software
Posts: 14038
Liked: 1051 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Return to PowerShell

Who is online

Users browsing this forum: No registered users and 1 guest