automatically import a Backup

PowerShell script exchange

automatically import a Backup

Veeam Logoby dohkogt » Tue Feb 01, 2011 5:16 am

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
dohkogt
Lurker
 
Posts: 1
Liked: never
Joined: Tue Feb 01, 2011 5:10 am
Full Name: Kenneth Perez

Re: automatically import a Backup

Veeam Logoby Vitaliy S. » Tue Feb 01, 2011 8:54 am

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!
Vitaliy S.
Veeam Software
 
Posts: 19539
Liked: 1097 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

adding Backups

Veeam Logoby tom.stevens » Mon Feb 21, 2011 10:04 am

[merged into existing discussion]

Is it Possible to Add Backups (VBK) files Automaticly?
tom.stevens
Novice
 
Posts: 9
Liked: 1 time
Joined: Mon Feb 21, 2011 9:58 am
Full Name: tom Stevens

Re: automatically import a Backup

Veeam Logoby tom.stevens » Mon Feb 21, 2011 2:29 pm

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

Re: automatically import a Backup

Veeam Logoby tom.stevens » Mon Feb 21, 2011 2:32 pm

What about Removing Backups from VEEAM (E.G. removeing the backup from VEEAM but not the Backup Files)
tom.stevens
Novice
 
Posts: 9
Liked: 1 time
Joined: Mon Feb 21, 2011 9:58 am
Full Name: tom Stevens

Re: automatically import a Backup

Veeam Logoby Vitaliy S. » Mon Feb 21, 2011 3:33 pm

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
Vitaliy S.
Veeam Software
 
Posts: 19539
Liked: 1097 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: automatically import a Backup

Veeam Logoby tom.stevens » Fri Jun 24, 2011 12:43 pm

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
tom.stevens
Novice
 
Posts: 9
Liked: 1 time
Joined: Mon Feb 21, 2011 9:58 am
Full Name: tom Stevens

Re: automatically import a Backup

Veeam Logoby Alexey D. » Fri Jun 24, 2011 12:55 pm

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.
Alexey D.
 

Re: automatically import a Backup

Veeam Logoby tom.stevens » Fri Jun 24, 2011 3:42 pm

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?
tom.stevens
Novice
 
Posts: 9
Liked: 1 time
Joined: Mon Feb 21, 2011 9:58 am
Full Name: tom Stevens

Re: automatically import a Backup

Veeam Logoby Vitaliy S. » Mon Jun 27, 2011 7:55 am

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.
Vitaliy S.
Veeam Software
 
Posts: 19539
Liked: 1097 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests