Printed list of tapes

Everything about backing up to tape

Re: Printed list of tapes

Veeam Logoby mariovaleri » Mon Feb 10, 2014 8:00 am

hi, thanks to all, but i thinking about something like to add a column "tape used" to the view "history/tape". in this way is easy to change last tapes used during a weekend full backup.
mariovaleri
Lurker
 
Posts: 2
Liked: never
Joined: Mon Feb 03, 2014 10:46 am

Re: Printed list of tapes

Veeam Logoby v.Eremin » Mon Feb 10, 2014 8:33 am

As mentioned, for now you can rely on tape job email report that includes barcodes and names of all tapes that were used in the corresponding job session. Also, thank you for the feedback; much appreciated.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Printed list of tapes

Veeam Logoby PJ-BNE » Wed Feb 12, 2014 1:19 am

v.Eremin wrote:Otherwise, if you want to get the latest written tape, then, you can use the following one-liner:

Code: Select all
Get-VBRTapeMedium | where {$_.LastWriteTime -ne $Null} | Sort-Object {$_.LastWriteTime} -Descending | Select-Object -First 1

Thanks.


I've been attempting to create a script very similar to this but instead of the most recently written tape, I am looking for any tape that has been written to in the last x days. Unfortunately I don't know a whole lot about PowerShell so I thought I'd see if anyone else had any suggestions.
PJ-BNE
Lurker
 
Posts: 2
Liked: never
Joined: Wed Feb 12, 2014 1:09 am

Re: Printed list of tapes

Veeam Logoby v.Eremin » Wed Feb 12, 2014 8:59 am 1 person likes this post

The following script returns the list of tapes that have been written within last 7 days. Instead of 7, you can type whatever number you want to:

Code: Select all
Get-VBRTapeMedium | where {($_.lastwritetime -ne $null) -and (((Get-Date) - $_.lastwritetime).days -le 7)} | Sort-Object {$_.LastWriteTime} -Descending


Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Printed list of tapes

Veeam Logoby PJ-BNE » Wed Feb 12, 2014 12:41 pm

Thanks. That works perfectly and is simpler than the approach I was taking.
PJ-BNE
Lurker
 
Posts: 2
Liked: never
Joined: Wed Feb 12, 2014 1:09 am

Re: Printed list of tapes

Veeam Logoby v.Eremin » Wed Feb 12, 2014 1:34 pm

Also, you can add Select-Object method in order to output only chosen parameters (barcode, name, last write time) of tape mediums, instead of outputting all of them:

Code: Select all
Get-VBRTapeMedium | where {($_.lastwritetime -ne $null) -and (((Get-Date) - $_.lastwritetime).days -le 7)} | Sort-Object {$_.LastWriteTime} -Descending | Select-Object -Property @{N="Tape Name";E={$_.name}}, @{N="Barcode";E={$_.Barcode}}, @{N="Last Write Time";E={$_.LastWriteTime}}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Printed list of tapes

Veeam Logoby raj.patel » Sun Jun 01, 2014 12:42 am

Hi All,

Im new to Veeam powershell scripting. Im trying to get a script to run daily to advises me which tapes I need to export.

I wish to report on the last write time and check if the location is online
Get-VBRTapeMedium | where {($_.lastwritetime -ne $null -and $_.LocationEx -like "Online") -and (((Get-Date) - $_.lastwritetime).days -le 7)} | Sort-Object {$_.LastWriteTime} -Descending | Select-Object -Property @{N="Tape Name";E={$_.name}}, @{N="Barcode";E={$_.Barcode}}, @{N="Last Write Time";E={$_.LastWriteTime}}

This below script works but im not sure why because all im doing is replacing the variable "offline with "online"
Get-VBRTapeMedium | where {($_.lastwritetime -ne $null -and $_.LocationEx -like "offline") -and (((Get-Date) - $_.lastwritetime).days -le 7)} | Sort-Object {$_.LastWriteTime} -Descending | Select-Object -Property @{N="Tape Name";E={$_.name}}, @{N="Barcode";E={$_.Barcode}}, @{N="Last Write Time";E={$_.LastWriteTime}}

Is there a way to export this media automatically based on a script like the above?

Thank you
raj.patel
Lurker
 
Posts: 2
Liked: never
Joined: Thu May 29, 2014 2:44 pm

Re: Printed list of tapes

Veeam Logoby Gostev » Sun Jun 01, 2014 11:38 am 1 person likes this post

We are adding this report into the next version of Veeam ONE.
This new report will list all tapes, and their retention.
Gostev
Veeam Software
 
Posts: 21396
Liked: 2350 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Printed list of tapes

Veeam Logoby raj.patel » Mon Jun 02, 2014 5:18 am

Hi All,

I managed to get my script working please find below

----Used to give you tapes to export ----
Get-VBRTapeMedium | where {($_.lastwritetime -ne $null -and $_.IsOnline -eq $True) -and (((Get-Date) - $_.lastwritetime).days -le 7)} | Sort-Object {$_.LastWriteTime}

----Used to give you tape to import----
Get-VBRTapeMedium | Where-Object { $_.IsOverwriteProtectionPeriodOver() -eq $True -and $_.LocationEx -like "Offline"}

I have written smtp emails for each and these run on a windows scheduled task.

Im currently working on a script to export the media to mailslot / I/E slot so there will be no need for user interaction
raj.patel
Lurker
 
Posts: 2
Liked: never
Joined: Thu May 29, 2014 2:44 pm

Re: Printed list of tapes

Veeam Logoby v.Eremin » Wed Jun 04, 2014 7:34 am

Tape medium can be ejected and exported via the following commandlets. Eject-VBRTapeMedium and Export-VBRTapeMedium, accordingly. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Printed list of tapes

Veeam Logoby yitzchok.berger » Tue Apr 21, 2015 10:39 am

How could we take this one step further and add the job(s) that used specific tapes.

Ideally, I'm looking for the following:

Barcode VM Count Job Name Date Written
--------- ------------ ---------------- ----------------
XX1111 4 Oracle Servers 20-APR-2015 11:00 PM
20 App Servers 21-APR-2015 01:00 AM

XX2222 15 Web Servers 21-APR-2015 03:00 AM
yitzchok.berger
Novice
 
Posts: 9
Liked: never
Joined: Sun Mar 29, 2015 9:43 am
Full Name: Yitzchok Berger

Re: Printed list of tapes

Veeam Logoby v.Eremin » Tue Apr 21, 2015 2:05 pm

There is a topic speaking about how to list tapes used by corresponding job; might be worth reviewing. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to Tape



Who is online

Users browsing this forum: No registered users and 4 guests