Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9920

PowerShell • Re: Get-VBRBackupFile

$
0
0
Well looks like i lied.. not my last post...

I hit an issue, on our hardened SOBR I came across folders with Backup Copy job name but with _1...

I am guessing that someone had deleted and recreated the Backup Copy Job... So Veeam has created a folder with Backup Copy Name, but with _1, as there is already a folder with the job name...

So i have changed the function, to not use the job name, but use the actual path to create the full file path. For me I have commented out the jobname section as I don't think I need it.. (I am not fully sure what the $Backup.JobID -eq '00000000-0000-0000-0000-000000000000' means);
$jobname.ToString now becomes $Backup.DirPath.ToString()

Code:

function Get-SOBRBackupFilePathFromBackupV12 {param([Parameter(Mandatory=$true, Position=0)][Object]$Backup,        [Parameter(Mandatory=$true, Position=1)]        [Object]$backupfile,        [Parameter(Mandatory=$true, Position=2)]        [String]$SourceBackup)    write-host "processing $($backupfile.FilePath)";$Repository = $Backup.FindRepository()[0];if($Repository.Type -eq "ExtendableRepository"){        $Extent = $Repository.GetRepositoryForExistingStorage($backupfile.Id);        <#if($Backup.JobID -eq '00000000-0000-0000-0000-000000000000'){            $JobName = $Backup.GetMetaFilePath().Elements[0];        }Else{            $jobName = $Backup.FindJob().Name;        }#>        $BackupFileSOBRSANPath = "$($Extent.Path.ToString(),$Backup.DirPath.ToString(),$SourceBackup.ToString(),$backupfile.filepath -join "/")";} else {$BackupFileSOBRSANPath = $backupfile.PartialPath;}    #Replace prohibitied path characters    $BackupFileSOBRSANPath = $BackupFileSOBRSANPath -replace ' |:', '_';return $BackupFileSOBRSANPath;}

Statistics: Posted by allan.warner — Nov 06, 2024 10:16 pm



Viewing all articles
Browse latest Browse all 9920

Latest Images

Trending Articles



Latest Images