-
- Novice
- Posts: 4
- Liked: 1 time
- Joined: Jan 29, 2015 9:03 am
- Full Name: Dennis
- Contact:
Erase any tape that is inserted
Hi,
I've been playing around with the following, but for some reason it doesn't work reliable.
Situation:
I want to perform a backup 2 disk (forever incremental) and when it's finished, it needs to be written to tape immediately.
The jobs themselves are configured in the correct manner and when the first one is done, the tape job kicks in nicely.
I have a script that runs at 6pm every day, and it should quick erase any tape that is inserted in the drive, so it can be used for the tapejob later that evening.
Script:
-----------------------------------------
Write-host “Prepare Tape for Veeam backup”
Add-PSSnapin -Name VeeamPSSnapin
Get-VBRTapeMedium | where {$_.location -like "Drive"} | Erase-VBRTapeMedium -confirm:$false
----------------------------------------
It seemed to have worked for a while, but yesterday and today the task scheduler reports that the job runned fine, but the tape is not erased.
As a result the data is added to the tape and it asks for another tape.
Could someone have a look at my script and tell me where to improve it?
Thanks!
Regards,
Dennis
I've been playing around with the following, but for some reason it doesn't work reliable.
Situation:
I want to perform a backup 2 disk (forever incremental) and when it's finished, it needs to be written to tape immediately.
The jobs themselves are configured in the correct manner and when the first one is done, the tape job kicks in nicely.
I have a script that runs at 6pm every day, and it should quick erase any tape that is inserted in the drive, so it can be used for the tapejob later that evening.
Script:
-----------------------------------------
Write-host “Prepare Tape for Veeam backup”
Add-PSSnapin -Name VeeamPSSnapin
Get-VBRTapeMedium | where {$_.location -like "Drive"} | Erase-VBRTapeMedium -confirm:$false
----------------------------------------
It seemed to have worked for a while, but yesterday and today the task scheduler reports that the job runned fine, but the tape is not erased.
As a result the data is added to the tape and it asks for another tape.
Could someone have a look at my script and tell me where to improve it?
Thanks!
Regards,
Dennis
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Erase any tape that is inserted
The script itself looks good. Will it work if you start it manually? Thanks.
-
- Novice
- Posts: 4
- Liked: 1 time
- Joined: Jan 29, 2015 9:03 am
- Full Name: Dennis
- Contact:
Re: Erase any tape that is inserted
Yes, when I started it manually all works fine.
I also re-scheduled it and let it run while I was watching, and (ofcourse...) it also ran fine again.
The tapes I'm using aren't new ones.
As a test I've tried to manually erase one of the tapes that 'didn't work', and guess what....once again no problem.
So I'm a bit confused now.....all things seems to be ok, they all work fine when done manually, but for some reason it just didn't work 2 times in a row.
Any suggestions?
I also re-scheduled it and let it run while I was watching, and (ofcourse...) it also ran fine again.
The tapes I'm using aren't new ones.
As a test I've tried to manually erase one of the tapes that 'didn't work', and guess what....once again no problem.
So I'm a bit confused now.....all things seems to be ok, they all work fine when done manually, but for some reason it just didn't work 2 times in a row.
Any suggestions?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Erase any tape that is inserted
For me it sounds like problem lies outside of Veeam, as script does it job perfectly, if executed manually. I would double check accounts under which script is executed (manually, Scheduler), whether they are the same or have same permissions, etc. Thanks.
-
- Novice
- Posts: 4
- Liked: 1 time
- Joined: Jan 29, 2015 9:03 am
- Full Name: Dennis
- Contact:
Re: Erase any tape that is inserted
Ok, thanks for your reply.
Just wanted to check if the script was fine.
I'll investigate further.
Thanks!
Just wanted to check if the script was fine.
I'll investigate further.
Thanks!
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Erase any tape that is inserted
As long as manual execution of script doesn't produce any issues, you can be sure that there is nothing wrong with the code itself. Thanks.
-
- Novice
- Posts: 4
- Liked: 1 time
- Joined: Jan 29, 2015 9:03 am
- Full Name: Dennis
- Contact:
Re: Erase any tape that is inserted
'problem' found.
When you insert a tape and do not perform an inventory first, the script won't run, since the drive/Veeam doesn't know there is a tape inserted.
To solve it I added a line to perform an inventory first.
Now it's working perfectly.
When you insert a tape and do not perform an inventory first, the script won't run, since the drive/Veeam doesn't know there is a tape inserted.
To solve it I added a line to perform an inventory first.
Now it's working perfectly.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Erase any tape that is inserted
Yep, having "Start-VBRTapeInventory -Library <>" line in the beginning of the script should do the trick, indeed. Glad to hear you've nailed it.
Who is online
Users browsing this forum: No registered users and 6 guests