First of all i know that there are many posts about Veeam Tape and scripting. I followed some of them and picked out what i needed to create a script that should work.
Well, that's it, it should work. When i execute it manually, the script does what's expected. When it's executed right within the tape job (Options => Advanced => Advanced => Run the following script before the job) it does not work. At least i see that when i check the running backup the next morning, Veeam is waiting for tape. Then i execute the script manually, and poof, the tape goes in the correct media pool and the job uses the inserted tape to write data.
I execute a batch script with the following code in it:
- Code: Select all
The batch script fires up Powershell and then this code will be executed:
- Code: Select all
Get-VBRTapeDrive -Name "Tape0" | Start-VBRTapeInventory
$tape = Get-VBRTapeMedium
Move-VBRTapeMedium -Medium $tape -MediaPool "TapePool" -Confirm:$false
This script is perhaps not the best one, but at least it works when executed manually. What i have to check is the media stuff. With every execution of this script the powershell output list will be longer and tells me that this and that tape is already in the specific media pool.
I have also to find out why it's not executed at the job runtime. I now created a task in Windows task scheduler and will see tomorrow if that works.
My customer has about 20 tapes. For each weekday a tape and this for about four weeks (monday 1, monday 2 and so on). When we switched from Backup Exec to Veeam i had similar issues. But then i deleted all the tapes with HP Library & Tape tools, and Veeam took every tape without any issue or scripting.
Now the tapes are once rotated completely and now Veeam does not accept the tapes without manual handling or automated via script.
Does any one of you have an idea why the script is not executed at job runtime? And how can this script be improved?
Thank you very much!