Comprehensive data protection for all workloads
Post Reply
cnaslund
Lurker
Posts: 2
Liked: never
Joined: Apr 10, 2013 10:39 pm
Full Name: Charles Naslund
Contact:

Need way to cancel Veeam Backup Automatically

Post by cnaslund »

Hi;

I have an issue where we have two drives for daily backups of our servers. Both drives are external USB drives which are rotated daily to offsite storage. One external drive is used by Microsoft Shadow Copy for backups of our physical servers, the other drive is used by Veeam to backup our ESXi 5.x servers. We have a PA do our drive rotations daily, but sometimes she can get the two drives (both with large labels on them) in the wrong cradles. When this occurs, the Veeam backup job running that day can corrupt the shadow backup image on the incorrectly inserted drive.

Is there a way to write a pre-run script which will check to see if the correct daily backup drive is inserted and if the script fails, cancelling the daily VEEAM job from running? Any suggestions are requested.

Thank You,
Chuck
foggy
Veeam Software
Posts: 21139
Liked: 2141 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Need way to cancel Veeam Backup Automatically

Post by foggy »

Chuck, you could probably have a scheduled task that kicks off a script checking whether the correct drive is inserted and then triggering the backup job using PowerShell.
zoltank
Expert
Posts: 230
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

Re: Need way to cancel Veeam Backup Automatically

Post by zoltank »

It might be easier to buy a physically different cradle for one of the backups, therefore making is physically impossible to insert the wrong drive into the wrong cradle.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Need way to cancel Veeam Backup Automatically

Post by veremin » 2 people like this post

Is there a way to write a pre-run script which will check to see if the correct daily backup drive is inserted and if the script fails, cancelling the daily VEEAM job from running?
It depends on your situation solely.

If your devices are mounted with the different names – like, device one is mounted as a “New Volume#1”, while another as “New Volume #2”, you can put into use something like this:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Job"
$backupDrive = $null
$VolumeName = "Name of mounted volume" #For instance, New Volume#1
get-wmiobject win32_logicaldisk | % {
    if ($_.VolumeName -eq $VolumeName) {
        $backupDrive = $_.VolumeName
        Write-Output "$VolumeName drive found!"
    }
}
if ($backupDrive -eq $null) {
    Write-Output "$VolumeName drive not found! "$Job.name" will be disabled"
    $Job.DisableScheduler()
} 
Otherwise, if these devices are mounted under different letters – like, device one is mounted as a “K:”, while another as “L:”, you should utilize the following version:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Job"
$backupDrive = $null
$VolumeName = "Name of your drive" | #For instance, K:
get-wmiobject win32_logicaldisk | % {
    if ($_.DeviceID -eq $VolumeName) {
        $backupDrive = $_.DeviceID
        Write-Output "$VolumeName drive found!"
    }
}
if ($backupDrive -eq $null) {
    Write-Output "$VolumeName drive not found! "$Job.name" will be disabled"
    $Job.DisableScheduler()
} 
If the corresponding device can’t be found, this script will output a message and disable given job.

As always don’t forget to test it, before implementing.

Hope this helps.
Thanks.
cnaslund
Lurker
Posts: 2
Liked: never
Joined: Apr 10, 2013 10:39 pm
Full Name: Charles Naslund
Contact:

Re: Need way to cancel Veeam Backup Automatically

Post by cnaslund »

Thank You for your replies!
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 85 guests