Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
Aerospace
Influencer
Posts: 11
Liked: 1 time
Joined: Mar 03, 2016 9:18 am
Full Name: Martin Müller
Contact:

Move Tapes Script as Post Script

Post by Aerospace »

Hello,

i have a script which move all Tapes from my Temp Pool in the Free Pool.
But as Post Script this Script does not work, only manuelly.

In the Log the Script was success

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
 }
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Move Tapes Script as Post Script

Post by PTide »

Hi,

Please try wrapping a .bat file around your .ps1 script and see if calling .bat instead of .ps1 will do the job.

Thank you.
Aerospace
Influencer
Posts: 11
Liked: 1 time
Joined: Mar 03, 2016 9:18 am
Full Name: Martin Müller
Contact:

Re: Move Tapes Script as Post Script

Post by Aerospace »

i do this currentlly via batch

Code: Select all

cd /d %~dp0
cls

powershell.exe -Noninteractive -file "Taeglich Temp - Tape in Media Pool Free verschieben.ps1"
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Move Tapes Script as Post Script

Post by PTide »

That looks unexpected - please contact our support team and post your case ID in this thread.

Thank you.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Move Tapes Script as Post Script

Post by veremin »

But as Post Script this Script does not work, only manuelly.
Are you positive you were using the same account in both cases? I mean doesn't Veeam service account lack required permissions by any chance? Thanks.
Aerospace
Influencer
Posts: 11
Liked: 1 time
Joined: Mar 03, 2016 9:18 am
Full Name: Martin Müller
Contact:

Re: Move Tapes Script as Post Script

Post by Aerospace » 1 person likes this post

this works fine

1. Change the Backup Job to run a batch file instead of the powershell directly, e.g. "E:\Batches\TestBatchFile.bat"
2. Inside the batch file, use the "start" command to launch the powershell, e.g. Start powershell.exe -Noninteractive -File E:\Batches\TestPowershell.ps1
3. Inside the Powershell, pause the script for 60 seconds e.g. Start-Sleep -s 60
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests