-
- Novice
- Posts: 6
- Liked: never
- Joined: Jul 01, 2020 4:23 pm
- Full Name: Anthony Quepons
- Contact:
Deleting Archived VTL Tapes
Does anybody have a handy Powershell command that can reach into AWS via AWS CLI or Powershell to delete archived VTL Tapes in storage gateway? I know I could log into the AWS gateway manually on a monthly basis and delete that way. But it would be nice to just setup a Powershell job that would reach into the storage gateway and delete. Thank you.
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Deleting Archived VTL Tapes
Hi,
If it comes to powershell, you might need to use AWS.Tools.StorageGateway module for that.
I delete unused tapes with the script below adapted for archived tapes as per your question:
I'm sure there is also a bunch of examples for aws cli and SDKs for the same action.
I tend to use Javascript SDK quite often, so I'd probably research this method.
Hope it helps,
Oleg
If it comes to powershell, you might need to use AWS.Tools.StorageGateway module for that.
I delete unused tapes with the script below adapted for archived tapes as per your question:
Code: Select all
$tapes = Get-SGTape -Region eu-west-3
foreach ($tape in $tapes) {
$archived = Get-SGTapeArchive -TapeARN $tape.TapeARN -GatewayARN $tape.GatewayARN -Region eu-west-3
Remove-SGTapeArchive -TapeARN $archived.TapeARN -Region eu-west-3
}
I tend to use Javascript SDK quite often, so I'd probably research this method.
Hope it helps,
Oleg
-
- Influencer
- Posts: 22
- Liked: 4 times
- Joined: Jul 22, 2020 1:25 pm
- Full Name: Stuart Little
- Contact:
Re: Deleting Archived VTL Tapes
Can this script be modified to delete tapes (based on an input file that contains barcodes) ?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Deleting Archived VTL Tapes
You can just get file contents firsthand and then iterate through each barcode to filter tapes by a tape barcode name. Example:
Code: Select all
$barcodes = Get-Content $barcodes.txt
$tapes = Get-SGTape -Region eu-west-3
foreach ($barcode in $barcodes) {
$tape =$tapes | where {$_.TapeBarcode -eq $barcode}
...
}
Who is online
Users browsing this forum: No registered users and 6 guests