PowerShell script exchange
Post Reply
Moopere
Enthusiast
Posts: 71
Liked: 14 times
Joined: Jul 06, 2018 3:44 am
Full Name: Moopere
Contact:

export file names from backup to csv

Post by Moopere »

Hello Veeamers,

I'm hoping someone can give me some thoughts with the following requirement which I think I'll need to script up in Powershell.

- Backup copies are made to tape and to USB hard drives for archival purposes (scheduled via Veeam GUI)
- Before those media are removed from the Veeam backup machine, dump the filenames/paths into a CSV file for later review and search (this is the powershell bit I think).

Note that Enterprise Manager is not a solution for this requirement as it doesn't record or understand the concept of storage that is not connected to the veeam server - backup copies to tape for example - when a file is searched for in EM its location is simply reported as 'TAPE', doesn't tell you _which_ tape. Similarly for USB or other removeable media. You don't get any vision of _which_ media the required file resides on if its no longer in a live repository.

As end-users don't seem to be able to access the file catalog that Veeam (optionally) uses internally the thought occurs that I can probably run a post-job script which access the backup copy just made to whatever media, export-list-dump the file names/paths/sizes/dates and then, in the future when restores are required, can generate a complete list of media that contains files of interest.

A bit of rummaging in the forums is leading me to believe that I will need to kick off a FLR process and then use powershell's get-childitem to export the files to a CSV file.

My post today is really about:

- Is there a less convoluted way to go about this?
- As I don't actually want to do a FLR, I just want a file listing, is there any danger in going down this road? ie, opening FLR processes in Veeam causing any problems when they don't actually complete?
Mildur
Product Manager
Posts: 9847
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: export file names from backup to csv

Post by Mildur »

Hi Moopere
Before those media are removed from the Veeam backup machine, dump the filenames/paths into a CSV file for later review and search (this is the powershell bit I think).
Can you tell me a little bit more about "filenames/paths"? Do you need to know what Guest OS Files you have on this medias? Or just which Backup Files?

Thanks Fabian
Product Management Analyst @ Veeam Software
Moopere
Enthusiast
Posts: 71
Liked: 14 times
Joined: Jul 06, 2018 3:44 am
Full Name: Moopere
Contact:

Re: export file names from backup to csv

Post by Moopere »

@Fabian: Yes, file/path/size/date of the files in the guest OS's ... really the backups in general. If I'm backing up physical I want those filenames too.

Don't need to get too fancy with this, I can manipulate the raw data elsewhere - but hoping a not too convoluted solution might exist. I got what I wanted by manually kicking off an FLR and cancelling it after exporting the filesystem structure to CSV, but I want to automate.
Mildur
Product Manager
Posts: 9847
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: export file names from backup to csv

Post by Mildur »

If you are using File to Tape Jobs, then you can give this script a try.
It's not supported by us, but it doesn't change anything in the database, so it's ok to use it.
Other customers confirmed it's still working for V11.

For the USB hard drives, a FLR Session would be the way to get the content of the restore point. Veeam do not log each protected file in the configuration database.
We have the indexing, but that cannot be accessed by other tools that I know of. And we don't have any Powershell Commands to list the content.
You could use our Data Integration API to publish the last restore point from the USB hard drive, export the metadata of all files to CSV, and then unpublish the content.

For Backup to Tape Jobs, you must copy the restore points back to disk based backup repository to mount the restore point.
But you can export the file list from your main backup job. The Tape Job contains the same Guest Files as the Backup Job.
Opening FLR processes in Veeam causing any problems when they don't actually complete?
Backups will continue to work, when you have mounted a restore point. When Veeam wants to delete the mounted restore point because it's out of retention period, then you will get a warning. Normally the FLR Session will already be closed (inactive FLR session timeout) when that could happen.
Product Management Analyst @ Veeam Software
Moopere
Enthusiast
Posts: 71
Liked: 14 times
Joined: Jul 06, 2018 3:44 am
Full Name: Moopere
Contact:

Re: export file names from backup to csv

Post by Moopere »

@Mildur

Thanks for the heads-up and hints.

This is not going to be as straightforward as I'd hoped I don't think given the complexities of having to handle different backup/archive media in different ways.

I hadn't considered the Data Integration API previously, will take a long look at that.

Given that backup to tape jobs in particular would need quite a process to extract file data from I'm now considering whether I'd be best served in this endeavour by exporting the filesystem of the object to be backed up from the live filesystem itself rather than via the backup files. The downside here is that I'd be creating a list of files that _should_ have been backed up, rather than a qualified list of those that _did_ actually make it to the vbk.

There is potential for one to not be the same as the other - still, as I'm talking ultimately about offline archives here rather than a DR scenario, it might be sufficiently good and will probably be orders of magnitude easier to implement.
Mildur
Product Manager
Posts: 9847
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: export file names from backup to csv

Post by Mildur » 1 person likes this post

Yes, unfortunately there is no easy way to do it today.
If you have done a image level backup of an entire VM, you will have always all files included.
If this files can be restored, is another topic. This can only be found out with a restore test.
If you script creating a list before the backup, this files will be included in the backup of the VM. Of course, there will be a gap between running the script and creating the snapshot of the vm. So there is a small possibility that not all files are included.
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests