Write latest active full produced .vbk to tape

PowerShell script exchange

Re: Write latest active full produced .vbk to tape

Veeam Logoby remko.de.koning » Tue May 12, 2015 7:25 am

I finally had the time to take a look at this. Thanks all for your excellent feedback.
I seem to have an additional issue with Powershell. The Snap-in does not load.

Code: Select all
Start-VBRJob LatestProdVBK
Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 4.
At line:1 char:1
+ Add-PSSnapin VeeamPSSnapin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapin:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Googling on the subject reveals that I should have a "Veeam.Backup.PowerShell.dll" in the C:\Program Files\Veeam\Backup and Replication\Backup folder.
It does not seem to be there.
Any advice what I can do to correct this or should I open a new topic or create a support case?
remko.de.koning
Enthusiast
 
Posts: 72
Liked: 13 times
Joined: Wed May 21, 2014 12:15 pm
Full Name: Remko de Koning

Re: Write latest active full produced .vbk to tape

Veeam Logoby remko.de.koning » Tue May 12, 2015 7:57 am

Whoops.. sorry.. Found it :oops:
http://www.veeam.com/kb1489
remko.de.koning
Enthusiast
 
Posts: 72
Liked: 13 times
Joined: Wed May 21, 2014 12:15 pm
Full Name: Remko de Koning

Re: Write latest active full produced .vbk to tape

Veeam Logoby remko.de.koning » Tue May 12, 2015 8:25 am

Still not going as smoothly as I hoped.

Installing the Powershell Add-In from the DVD went OK. However, I am still unable to use it.
Most likely because I am running "patch2" of Veeam Backup and Replication.

Code: Select all
PS C:\Users\p797784> Get-PSSnapin -Registered
PS C:\Users\xxxx> set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe
PS C:\Users\xxxx> installutil "C:\Program Files\Veeam\Backup and Replication\Backup\Veeam.Backup.PowerShell.dll"
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.8007
Copyright (c) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\Veeam\Backup and Replication\Backup\Veeam.Backup.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..


I am uncertain if I should install patch 2 again. I am afraid I might break something.
remko.de.koning
Enthusiast
 
Posts: 72
Liked: 13 times
Joined: Wed May 21, 2014 12:15 pm
Full Name: Remko de Koning

Re: Write latest active full produced .vbk to tape

Veeam Logoby v.Eremin » Wed May 13, 2015 2:23 pm

Have you tried a solution provided in the adjacent thread? If nothing helps, ask support team for assistance. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Write latest active full produced .vbk to tape

Veeam Logoby ayazkhawar » Mon May 25, 2015 6:03 am

It would be really good if a generic script will available which full active and all incremental points for tape to file job.
ayazkhawar
Novice
 
Posts: 8
Liked: never
Joined: Mon Feb 23, 2015 11:00 am
Full Name: M. Ayaz Khawar

Re: Write latest active full produced .vbk to tape

Veeam Logoby v.Eremin » Mon May 25, 2015 8:40 am

Not sure whether I understand your question. You mean the provided script should first list all full backups and then give your ability to choose which one of listed .vbks should be archived to tapes?
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Write latest active full produced .vbk to tape

Veeam Logoby ayazkhawar » Mon May 25, 2015 9:28 am

A generic script which find the latest full chain of backup. i.e last full+ all incremental point of job and archive on file to tape.
ayazkhawar
Novice
 
Posts: 8
Liked: never
Joined: Mon Feb 23, 2015 11:00 am
Full Name: M. Ayaz Khawar

Re: Write latest active full produced .vbk to tape

Veeam Logoby v.Eremin » Mon May 25, 2015 9:43 am

Then, you should modify the script provided by Michael, so that, it takes the latest .vbk, not the second latest one.

Code: Select all
$LatestVbk = $ProdBackupDirVbks | group directory | foreach {@($_.group | sort {[datetime]$_.creationtime} -desc)[0]}


Then, check the given directory, using .vib file mask. After that, find .vib files which creation dates newer then creation date of the latest .vbk. Finally, set both latest .vbk and dependent .vibs as files to tape job source.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 2 guests