Discussions related to exporting backups to tape and backing up directly to tape.
Aerospace
Influencer
Posts: 11 Liked: 1 time
Joined: Mar 03, 2016 9:18 am
Full Name: Martin Müller
Contact:
Post
by Aerospace » Mar 09, 2016 12:41 pm
this post
Hey Guys,
i need your help on my Script.
I have more MediaPools, because i need each day a Fullbackup with all files, so i move all Tapes befor a backup to an other MediaPool.
Now i need a script which move the Tapes from the temporary mediapool back to the free mediapool, when the Backup was success.
Powershell says always he don't know this parameter "GetLastResult"
Code: Select all
Add-PSSnapin VeeamPSSnapIn
$jobName = "Backup2Tape - Täglich"
if ((Get-VBRJob | where {$_.Name -eq $jobName}).GetLastResult() -eq "Success")
{
$tape = Get-VBRTapeMedium -MediaPool "Täglich Temp"
Move-VBRTapeMedium -Medium $tape -MediaPool "Free" -Confirm:$false
}
PTide
Product Manager
Posts: 6551 Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:
Post
by PTide » Mar 09, 2016 3:20 pm
this post
Hi,
Code: Select all
Get-VBRJob | where {$_.Name -eq $jobName}).GetLastResult() -eq "Success")
Will give you nothing. Please use
Get-VBRTapeJob instead:
Code: Select all
Get-VBRTapeJob | where {$_.name -eq ""Backup2Tape - Täglich"}
The value you are looking for is stored in the
Last.Result field:
Code: Select all
$job = Get-VBRTapeJob | where {$_.Name -eq "Test"}
echo $job.LastResult
Success
Hope this helps.
Thank you.
Aerospace
Influencer
Posts: 11 Liked: 1 time
Joined: Mar 03, 2016 9:18 am
Full Name: Martin Müller
Contact:
Post
by Aerospace » Mar 10, 2016 7:13 am
this post
it work's, thank you very much!
Code: Select all
Add-PSSnapin VeeamPSSnapIn
$jobName = "Backup2Tape - Täglich"
$job = Get-VBRTapeJob | where {$_.Name -eq "$jobName"}
if ($job.LastResult -eq "Success")
{
$tape = Get-VBRTapeMedium -MediaPool "Täglich Temp"
Move-VBRTapeMedium -Medium $tape -MediaPool "Free" -Confirm:$false
}
Users browsing this forum: No registered users and 25 guests