PowerShell script exchange
munklarsen
Influencer
Posts: 23 Liked: 9 times
Joined: Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen
Contact:
Post
by munklarsen » Mar 06, 2015 12:10 pm
this post
Hi guys,
I've been trying to find a way to find the entire path of the folder used for storing the backups of a particular job.
I've tried but that only gives me the root of the storage repository, not the subdirectory where my backup is stored.
Code: Select all
(Get-VBRJob -Name 'jobName').TargetDir
Veeam must know this directory's name and have it stored somewhere - the thing is that someone changed the name of the backup job and that was how i used to generate the entire path to the backup.
veremin
Product Manager
Posts: 20413 Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Mar 06, 2015 12:12 pm
this post
Just a quick question - what type of repository you're using? Windows-based, Linux-based, CIFS share, etc.
munklarsen
Influencer
Posts: 23 Liked: 9 times
Joined: Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen
Contact:
Post
by munklarsen » Mar 06, 2015 12:29 pm
1 person likes this post
Hi...
As always, you spend some time working on it, then you turn to the forums for help... and then five minutes later, you solve the issue.
Fixed it like this:
Code: Select all
$JobID = (Get-VBRJob -Name '<JobName>').Info.Id
(Get-VBRBackup | Where-Object ({$_.Info.JobId -eq $JobID})).DirPath
I could find the directory using the Get-VBRBackup and but this had no references to the new job name. So had to find some common ground which then was the Info.Id of the Get-VBRJob and the Info.JobId of the Get-VBRJob.
munklarsen
Influencer
Posts: 23 Liked: 9 times
Joined: Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen
Contact:
Post
by munklarsen » Mar 06, 2015 12:31 pm
this post
And to answer you question v.Erimin, I'm using a Windows repository.
Users browsing this forum: No registered users and 14 guests