Comprehensive data protection for all workloads
Post Reply
trustblomme
Influencer
Posts: 22
Liked: 3 times
Joined: Nov 16, 2012 9:07 am

veeam.backup.validator.exe logging and scripting

Post by trustblomme »

Hello,

does anyone use this tool in a script so you can have logging after an validation of a backup run? The tool veeam.backup.validator.exe checks the integrity of a backup file on a deeper level.

In our test case we did have some problems with zlib compression errors on validation and I would like to see if we can automate the backup validation?

Thanks

Steven
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2800 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: veeam.backup.validator.exe logging and scripting

Post by Vitaliy S. »

Hi Steven,

Why not to use SureBackup jobs to validate your backup files consistency?

Thanks!
Gostev
Chief Product Officer
Posts: 31814
Liked: 7302 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: veeam.backup.validator.exe logging and scripting

Post by Gostev »

For example, because it is not available in the Standard Edition ;)
trustblomme
Influencer
Posts: 22
Liked: 3 times
Joined: Nov 16, 2012 9:07 am

Re: veeam.backup.validator.exe logging and scripting

Post by trustblomme »

Hi Vitaliy,

I can do an instant vm recovery of the machine that give's a validate error. So in sure backup, I don't dedect an error, only by doing a validation on the file I receive the validation error.

Or choice would be the Enterprise edition because the sure backup is a must-have function :).

Thanks for the reply!

Steven
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam.backup.validator.exe logging and scripting

Post by veremin »

Hi, Steven.

I’ve been trying to find a solution corresponding your task, since you raised this question. And this's what I managed to find.

First of all, it seems impossible to me to output the results of Veeam Validator(VV) execution to a file and it doesn’t matter what type of method is being used to do it. Honestly, in my case I’ve tried a variety of them, including:

1)Simple .bat-redirection tools (->, >>) in a conjunction with different ways to execute VV.
2)Some tricks with echo command.
3)PowerShell methods, such as: Tee-Object, Write-Output, Start-Transcript and etc. Also, together with various types of execution.

Unfortunately, each time during progress bar stage I ended up with the same or relatively the same error:

Code: Select all

Validation failed


After several experiments, it turned out that VV saved its log into the following directory: C:\ProgramData\Veeam\Backup\Util.VmBackupValidate.log.
This log is nothing but a huge compilation of information related to each execution of VV you’ve ever made. Even though much part of it can’t be used for any purpose, this log has very important strings in its end, providing status of validation, like:

Code: Select all

The following VMs are corrupted
Or

Code: Select all

Validation finished successfully 
Thus, if you are willing to have separate log-file which will have information regarding only particular validation session, and which will be created after VV execution, you should follow the next steps:

1)Delete existing VV-log file. It will be recreated during the next run, but this time only recent information will fall into it.
2)Implement this PowerShell-script (Script executes validation of a given backup, after validation has been finished, it moves log-file to set directory and renames it. In my case, log-file name is represented by the name of backup I’m trying to validate, full date and time. I find this combination to be very useful).

Code: Select all

$NameOfBackup = "Test#28"
$filepath= 'D:\Validation Logs\'+$NameOfBackup+'_'+("{0:yyyy-MM-dd_HH.mm.ss}" -f (get-date))+'.txt'
$tool='"C:\Program Files\Veeam\Backup and Replication\Veeam.Backup.Validator.exe"'
$Parameter = "/backup:$NameOfBackup"
Invoke-Expression "& $tool $Parameter" 
New-Item -Path $filepath -ItemType file
Move-Item C:\ProgramData\Veeam\Backup\Util.VmBackupValidate.log $filepath -force 

*Note: Test#28 - name of my backup job, D:\Validation Logs - directory where i store my VV logs, though, you can specify both of them however you want.


Thereby, eventually I’m able to deal with my validation routine. After each running of the script, there is a .txt-file named in certain way, placed in specified directory and which has information I specifically need.

Feel free to use/modify it however you want.
Should any questions arise, don't hesitate to let me know. I'll try my best to shed a light on the dark sides.

Hope this helps.
Thanks.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam.backup.validator.exe logging and scripting

Post by veremin »

Additionally, you can implement this useful feature. Instead of using

Code: Select all

$NameOfBackup = “Test#28” (or whatever name you input here) 
you can use this string

Code: Select all

$NameOfBackup = read-host "Enter name of backup you're going to validate" 
Thus, in the beginning of the script you will be asked to input name of backup-file you’re willing to validate.

Thanks.
mobin.qasim
Enthusiast
Posts: 58
Liked: 1 time
Joined: Jun 19, 2013 7:23 pm
Full Name: Mobin Qasim
Contact:

Re: veeam.backup.validator.exe logging and scripting

Post by mobin.qasim »

Guys,

Sorry I'm new to Powershell to need your help.

I ran the first script and it's giving me following error Invalid command line: unknown argument "Job"

My Veeam Job name is: Backup Job 1 Test
I'm using script as $NameOfBackup = "Backup Job 1 Test" on the first line.

Though backup job which don't have space in it's name works fine without any errors e.g. $NameOfBackup = "TESTVM100"

Also if I run script by modifying the first line and adding $NameOfBackup = read-host "Enter name of backup you're going to validate"
And typing name "Backup Job 1 Test" giving me the following two errors after the message Validation completed successfully.

New-Item : Illegal characters in path.
At C:\Users\mobin.qasim\Desktop\mobin.ps1:6 char:9
+ New-Item <<<< -Path $filepath -ItemType file
+ CategoryInfo : NotSpecified: (:) [New-Item], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.NewItemCommand

Move-Item : Illegal characters in path.
At C:\Users\mobin.qasim\Desktop\mobin.ps1:7 char:10
+ Move-Item <<<< C:\ProgramData\Veeam\Backup\Util.VmBackupValidate.log $filepath -force
+ CategoryInfo : NotSpecified: (:) [Move-Item], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.MoveItemCommand

Could you guys please help.

Regards
tkimnguyen
Novice
Posts: 3
Liked: never
Joined: Feb 09, 2023 9:24 pm
Full Name: T. Kim Nguyen
Contact:

Re: veeam.backup.validator.exe logging and scripting

Post by tkimnguyen »

trustblomme wrote: Dec 04, 2012 11:53 am does anyone use this tool in a script so you can have logging after an validation of a backup run?
Just in case anyone else is looking for logging of validator results, the version I'm using today has it built in.

See https://community.veeam.com/blogs-and-p ... idator-353

Specifically, the /report argument lets you specify the path to a report file:

Code: Select all

Veeam.Backup.Validator.exe /backup:backupname|backupid [/vmname:vmname]
   [/point:pointid] [/date:pointdate] [/time:pointtime] [/silence]
   [/skip] [/report:reportpath [/format:xml|html]]
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 66 guests