PowerShell script exchange
Post Reply
BB_GSY
Novice
Posts: 3
Liked: never
Joined: Apr 12, 2023 7:35 am
Full Name: Brendan B
Contact:

Extract Files to be processed from tape job

Post by BB_GSY »

Hello all.

I have been using file to tape for many years to do monthly air-gaped backups to tape. For each backup imutable copy we add the relevant monthly VBK to the file job and process. Works very well as using integrated tape wont work in our requirments.

However v12 now introduces per-VM backup copy jobs. So rather than 1 large VBK have now have many smaller ones. In order to ensure I capture the relevant files I indent to use the file mask to get the relevant files for the backup folder i.e. *2023-02-28*.vbk This will work.

Is there a powershell which for a given job will enumerate the files to be backed up so I can confirm my selections are valid? When selected single files, you know they are there by virtue of selecting them. By using a file mask, I introduce the opportunity for a typo.

Since the folder path will be the same each month, I know only need to change the mask to pickcup of the relevamt 'WM' retained files.
A powershell script once I have made the selections would be very useful.

Thanks in advance. BB
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Extract Files to be processed from tape job

Post by david.domask »

Heya @BB_GSY,

First, small note; Per-VM backups have existing for some time; v12 introduced _True Per-VM_, meaning that each backup chain (set of VBKs and their dependent increments) are truly independent of one another, whereas previously they were all under the same "backup umbrella" so to speak and couldn't easily be separated.

Can I ask, are you using File to Tape for your backups because of the Edition limitation? (Standard versus Enterprise (Plus)) I ask because with Backup to Tape jobs, this simplifies your request very much so as you don't have to worry, the Backup to Tape system will handle ensuring the right backups go to tape.

If you cannot use Backup to Tape due to the edition and migration to VUL isn't feasible right now, I would recommend take a different approach.

Get-VBRBackupFile should return backup files under a given CBackup object returned by Get-VBRBackup. Likely the properties returned there should be good enough to filter on, specifically checking if something is a Full backup and its CreationTime property.

This can be used to automate adding files to the File to Tape job, and since File to Tape won't re-backup data that is already on tape and hasn't changed, you should avoid double-backing up older data. You can even set it as a pre-job script on your File to Tape job, and assuming the script doesn't hit other issues, it will work. This has the benefit that you can even record which files were added by your script and keep a record somewhere for more convenient retrieval.

Give it a shot and see what you come up with, and if you need help on the finer points, show us your script and we'll help.
David Domask | Product Management: Principal Analyst
BB_GSY
Novice
Posts: 3
Liked: never
Joined: Apr 12, 2023 7:35 am
Full Name: Brendan B
Contact:

Re: Extract Files to be processed from tape job

Post by BB_GSY »

Thanks for the quick reply.

I am using Enterprise licensing but not plus licensing. I have looked at Backups to tape, but really want full control as to what ends up on the tape. Its a once a month job which needs to have the latest retained monthly VBK, no vibs etc. Using File level while manual process has worked very well as the number of files is limited..... Now if and when we convert to per-vm the number of files increases dramtically.

So I can use Get-VBRTapeBackup as this is a tape job..... can you give me an example of how I might use the CBackup object to enumerate the files it contains please? I'd looking for the files which will be enumerated using the specified mask

For example I add a path such as

/mnt/veeamrepo01/backup job 1 with a file mask of *2023-03-27*.vbk I would like it to list the files to backup in the same way as if I run ls -l *2023-03-27*.vbk

Thanks again for your help
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Extract Files to be processed from tape job

Post by david.domask »

Sure, happy to help.

First, since you have Enterprise Edition, I'd like to make the case for just Backup to Tape either with Simple or GFS media pools.

Backup to Tape can be set to only take from the Latest Chain, and if you do not enable incremental backups in the Tape Job, it will only take full backup files not yet on tape. You can easily schedule this for once a month, and it will grab the newest VBK that is not yet on tape. Keep in mind, Veeam Tape jobs don't interact with Source Job GFS, and instead make their own points based on their own schedule. So getting the GFS points already on disk isn't feasible except with File to Tape.

That being said, I really think that one of the following solutions is far better for you than custom code:

1. Use Backup to Tape with Simple Media pool, run it once a month and do not set it to backup VIBs. This will ensure that the VBK in the chain at the time of running will be backed up if you have a Forward Incremental Chain. If you have Forever Forward, you can use the Virtual Synthetic Full schedule for Tape to synthesize a Full backup live from the backup chain on the repository, and it will place a Full backup on tape, no need for extra space on disk as it's written directly to tape. This is also our "fastest" method for putting Full Backups on tape as of v12. If you use Reverse Incremental, it's even easier as the latest backup is always a Full and Backup to Tape only uses the Full backup.

2. Use Backup to Tape with a GFS media pool set to monthly. This is also pretty simple as regardless of your chain type, the most recent point available on the backup chain will be used for moving a full to tape on your desired schedule. If it's a full, Veeam will just copy it. If it's an increment, a Virtual Synthetic Full will be made.

I would really go for this and a combination of reporting from VeeamOne and the Email Notifications to validate that the points are being created on tape. I think it's far easier management wise and less to check on. Even those a script gives you a specific file name/path, you can get the same with VeeamOne (and with unsupported methods, via powershell), and I think you'll find the management much easier for both backups and restores.

Maybe test it out a bit before you commit to a scripting solution here? I know new workflows can be disruptive, but I really think that it's better to test out the intended way and ask on the parts not so clear for you as opposed to working with File to Tape. The benefits of Backup to Tape match or outweigh the benefits of the explicit File to Tape strategy.
David Domask | Product Management: Principal Analyst
BB_GSY
Novice
Posts: 3
Liked: never
Joined: Apr 12, 2023 7:35 am
Full Name: Brendan B
Contact:

Re: Extract Files to be processed from tape job

Post by BB_GSY »

Thank you. WIll give it a try this month. Ill use a simple media pool and specify to only process the latest VBK without incrementals selected. Its shame you cant specify the Monthly full as you say, as this gets us to the exact point e need to be; rather than always the latest VBK. None of the backups are forever incremental as they are all on immutable storage and so are set for weekly fulls / monthly.
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Extract Files to be processed from tape job

Post by david.domask »

Always welcome, good luck!

I am pretty sure it will work for you.

> Its shame you cant specify the Monthly full as you say, as this gets us to the exact point e need to be;

There actually are a few ways to accomplish this. With the Primary job GFS, they will be part of the simple retention and should be accessible for the Backup to Tape job to pull it. So you will get the desired points on tape as long as the Tape job runs after the desired full point is created.

Alternatively, just use a GFS Media Pool, and then you will know that you have a full restore point on tape for the exact day you desire within the tape job settings.

But let's see how this goes for you on your next tape-out.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests