Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
Tobias_Elfstrom
Enthusiast
Posts: 84
Liked: 8 times
Joined: Jul 04, 2012 6:32 am
Full Name: Tobias Elfstrom
Contact:

Delete old tapejob entries from backup catalog

Post by Tobias_Elfstrom »

Is there a supported way to manually delete restorepoints on tape and old tapejobs from the backup catalog? (and the list that you get when you select Backups/Tape in GUI)

I am aware of this way: "Removing tape from Catalog" but that only works if there still is record of that Media Set and the corresponding tapes. If there is no longer a MediaSet record viewable from the tape library view this way can 't be applied, this seams to happen when tapes are marked as free and reused.

Some Powershell examples:
Finding tapes for a current backup that is on tape:

Code: Select all

PS C:\Windows\system32> Foreach ($TapeCatalog in (Find-VBRTapeCatalog| where {$_.Parent.name -like 'AI002_Standard_vCluster3'}))
{
    $TapeCatalog.Parent.Name.Path, $TapeCatalog.name, (Get-VBRTapeMedium | where {$_.mediafamilyitem.id -eq $TapeCatalog.Versions.Parts.backupset.MediaFamilyId} | select barcode)  
}
AI002_Standard_vCluster32014-05-05T114120.vbk

Barcode                                                                                                                                                                                                                                                  
-------                                                                                                                                                                                                                                                  
080019L4                                                                                                                                                                                                                                                 
080000L4                                                                                                                                                                                                                                                 
AI002_Standard_vCluster3 on Tape 2014-05-05T115302 2014-05-05T115302 {8570DAEB-7449-4741-AEBD-998E737DDC2F}.vtm
080019L4                                                                                                                                                                                                                                                 
080000L4                                                                                                                                                                                                                                                 
AI002_Standard_vCluster32014-05-28T184234.vbk
080073L4                                                                                                                                                                                                                                                 
080064L4                                                                                                                                                                                                                                                 
080112L4                                                                                                                                                                                                                                                 
080125L4                                                                                                                                                                                                                                                 
AI002_Standard_vCluster32014-06-04T184238.vbk
080073L4                                                                                                                                                                                                                                                 
080064L4                                                                                                                                                                                                                                                 
080112L4                                                                                                                                                                                                                                                 
080125L4                                                                                                                                                                                                                                                 
AI002_Standard_vCluster3 on Tape 2014-05-05T115302 2014-06-04T184340 {8570DAEB-7449-4741-AEBD-998E737DDC2F}.vtm
080073L4                                                                                                                                                                                                                                                 
080064L4                                                                                                                                                                                                                                                 
080112L4                                                                                                                                                                                                                                                 
080125L4                                                                                                                                                                                                                                                 
AI002_Standard_vCluster32014-06-25T184250.vbk
080047L4                                                                                                                                                                                                                                                 
080065L4                                                                                                                                                                                                                                                 
080044L4                                                                                                                                                                                                                                                 
080050L4                                                                                                                                                                                                                                                 
AI002_Standard_vCluster3 on Tape 2014-05-05T115302 2014-06-25T184405 {8570DAEB-7449-4741-AEBD-998E737DDC2F}.vtm
080047L4                                                                                                                                                                                                                                                 
080065L4                                                                                                                                                                                                                                                 
080044L4                                                                                                                                                                                                                                                 
080050L4                                                                                                                                                                                                                                                 

Doing the same for a catalog that has no tapes... (and an example of a entry that I would like to remove)

Code: Select all

PS C:\Windows\system32> Foreach ($TapeCatalog in (Find-VBRTapeCatalog| where {$_.Parent.name -like 'AI002_vCluster3'}))
{
    $TapeCatalog.Parent.Name.Path, $TapeCatalog.name, (Get-VBRTapeMedium | where {$_.mediafamilyitem.id -eq $TapeCatalog.Versions.Parts.backupset.MediaFamilyId} | select barcode)  
}
AI002_vCluster32013-10-31T172448.vbk

PS C:\Windows\system32>  
Now I can do a $TapeCatalog.Delete() but I suspect that's not the whole story and I’m probably better off doing deletes in the following tables:

Code: Select all

[VeeamBackup].[dbo].[Backup.Model.Backups]
[VeeamBackup].[dbo].[Backup.Model.Points]
[VeeamBackup].[dbo].[Backup.Model.OIBs]
[VeeamBackup].[dbo].[Backup.Model.Storages]
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Delete old tapejob entries from backup catalog

Post by veremin »

What if you find all offline mediums (Get-VBRTapeMedium | ?{$_.IsOffline -eq $true}), find some internal parameter that unifies unneeded mediums (old lastwritetime or something), and, then, delete them (delete() method or similar)? Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests