PowerShell script exchange
Post Reply
dohkogt
Lurker
Posts: 1
Liked: never
Joined: Feb 01, 2011 5:10 am
Full Name: Kenneth Perez
Contact:

automatically import a Backup

Post by dohkogt »

Hi, I need import a Backup but i need do this automatically, have you any script to do this?, sorry but i dont know Nothing of PowerShell.

Thanks for your help

Vitaliy S.
Product Manager
Posts: 24334
Liked: 1884 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: automatically import a Backup

Post by Vitaliy S. »

Hello Kenneth,

In order to import backup files automatically, you need to use this PowerShell script:

Code: Select all

$h = (get-vbrserver)[0]
Import-VBRBackup -Server $h -FileName "c:\file.vbk"
Besides, if needed you can always get more information about this cmdlet from built-in Help option:

Code: Select all

get-help Import-VBRBackup
Thanks!

tom.stevens
Novice
Posts: 9
Liked: 1 time
Joined: Feb 21, 2011 9:58 am
Full Name: tom Stevens
Contact:

adding Backups

Post by tom.stevens »

[merged into existing discussion]

Is it Possible to Add Backups (VBK) files Automaticly?

tom.stevens
Novice
Posts: 9
Liked: 1 time
Joined: Feb 21, 2011 9:58 am
Full Name: tom Stevens
Contact:

Re: automatically import a Backup

Post by tom.stevens »

Thanks,

tom.stevens
Novice
Posts: 9
Liked: 1 time
Joined: Feb 21, 2011 9:58 am
Full Name: tom Stevens
Contact:

Re: automatically import a Backup

Post by tom.stevens »

What about Removing Backups from VEEAM (E.G. removeing the backup from VEEAM but not the Backup Files)

Vitaliy S.
Product Manager
Posts: 24334
Liked: 1884 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: automatically import a Backup

Post by Vitaliy S. »

Tom,

You can use Remove-VBRBackup cmdlet to remove VBK files automatically. To get more details, please take a look at help info:

Code: Select all

get-help Remove-VBRBackup

tom.stevens
Novice
Posts: 9
Liked: 1 time
Joined: Feb 21, 2011 9:58 am
Full Name: tom Stevens
Contact:

Re: automatically import a Backup

Post by tom.stevens »

Hi I am Running this command
$h = (get-vbrserver)[0]
Import-vbrbackup -server $h -FileName Y:\Servername\Servername.vbk and Are Getting this error
Import-VBRBackup : Object reference not set to an instance of an object.
At line:1 char:17

When i run get-Vbr-server i see two Entries
One for the remote server that took the backup and the local server i am trying to import to.

If is set $h = (get-vbrserver)[1] i am able to import the backup but only once
every backup i try to import gives me the same error

Alexey D.

Re: automatically import a Backup

Post by Alexey D. »

Tom, for this technical issue, please reach out to our support team - they will debug your script and will take a look which output every command provides.

tom.stevens
Novice
Posts: 9
Liked: 1 time
Joined: Feb 21, 2011 9:58 am
Full Name: tom Stevens
Contact:

Re: automatically import a Backup

Post by tom.stevens »

Hi Thanks,

All sorted now i have created a scripted which will Import the backups. not sure what the issue was.

Another issue i am having is removing the imported backups.
i am running the following:
Remove-VBRBackup -Backup "Backup_Imported"
and get the following
Remove-VBRBackup : Cannot bind parameter 'Backup'. Cannot convert the "GHVM-Uti
lity2_Imported" value of type "System.String" to type "Veeam.Backup.Core.CBacku
p".
At line:1 char:25
+ Remove-VBRBackup -Backup <<<< Backup_Imported
+ CategoryInfo : InvalidArgument: (:) [Remove-VBRBackup], Paramet
erBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Veeam.Backup.Powe
rShell.Command.RemoveVBRBackup

Is the Command Correct?

Vitaliy S.
Product Manager
Posts: 24334
Liked: 1884 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: automatically import a Backup

Post by Vitaliy S. »

Hello Tom,

Have you been able to check the correct syntax with get-help Remove-VBRBackup, as it seems like parameter -Backup is not recognized. Thanks.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests