Code: Select all
if ((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null) {
Add-PsSnapin VeeamPSSnapIn
}
$veeamJobName = "TaeglicheSicherung"
$jobFilename = "TaeglicheSicherung.vbk"
$BackupPath = "e:\VeeamBackups\TaeglicheSicherung"
if ((Get-VBRJob | ?{$_.Name -eq $veeamJobName}).GetLastResult() ) {
$latestOib = Get-VBRBackup | ?{$_.JobName -eq $veeamJobName} | Get-VBRRestorePoint | Sort CreationTime -Descending | Select -First 1
$latestOib
$storage = $latestOib.GetStorage()
$file = $storage.FileName
& del $BackupPath\$jobFilename
& cmd /c "mklink /H $BackupPath\$jobFilename $BackupPath\$file"
}
Code: Select all
if ((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null) {
Add-PsSnapin VeeamPSSnapIn
}
$veeamJobName = "Taegliche_Sicherung"
$jobFilename = "Taegliche_Sicherung.vbk"
$toolPath = "c:\bktools"
$nasPath = "/share/backup"
$puttySession = "nas02"
$user = "admin"
$pw = "Passwort"
if ((Get-VBRJob | ?{$_.Name -eq $veeamJobName}).GetLastResult() -eq "Success") {
$latestOib = Get-VBRBackup | ?{$_.JobName -eq $veeamJobName} | Get-VBRRestorePoint | Sort CreationTime -Descending | Select -First 1
$latestOib
$storage = $latestOib.GetStorage()
$file = $storage.FileName
& $toolPath\plink.exe "$puttySession" -pw "$pw" -l "$user" "rm $nasPath/$jobFilename;ln -s $nasPath/$file $nasPath/$jobFilename"
}