Start-VBRZip in Veeam Backup Free Edition

PowerShell script exchange

[MERGED] Veeam free Reverse Incremental Backup via Powershel

Veeam Logoby mckaynz » Fri Jul 07, 2017 2:00 am

Just wondering if it is possible to Reverse Incremental Backups via powershell if you are using the Free addition.

I have the PS script that Vladimir Eremin created but id does not have the option for Reverse Incremental Backups

IS this an option that is only in the Paid additions.

Cheers

LAwrence
mckaynz
Lurker
 
Posts: 1
Liked: never
Joined: Fri Jul 07, 2017 1:42 am

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby v.Eremin » Fri Jul 07, 2017 2:30 pm

Free edition does not support incremental backup. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby KMeli » Fri Jul 07, 2017 3:43 pm

Code: Select all
ind-VBRViEntity : Cannot validate argument on parameter 'Server'. The argument is null. Provide a valid value for the
argument, and then try running the command again.
At line:3 char:48
+   $VM = Find-VBRViEntity -Name $VMName -Server $Server
+                                                ~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Find-VBRViEntity], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Command.FindVBRViEntity


found vm:

Code: Select all
Start-VBRZip : Cannot validate argument on parameter 'Entity'. The argument is null. Provide a valid value for the
argument, and then try running the command again.
At line:12 char:40
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+                                        ~~~
    + CategoryInfo          : InvalidData: (:) [Start-VBRZip], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Commands.Backup.StartVBRZip


I am getting this error in running the script. Is this permissions related?
Thank you
KMeli
Novice
 
Posts: 3
Liked: never
Joined: Thu Apr 13, 2017 4:27 pm
Full Name: Karen Meli

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby MiguelLagos » Mon Jul 10, 2017 9:09 pm

After a few months I'm Back!!!

Write-Host $Server returns: Veeam.Backup.Core.Common.Chost

Find-VBRHvEntity -Server $Server

returns nothing

Find-VBRHvEntity -Server (Get-VBRServer -name "name of your server")

returns nothing


Get-VBRServer -name "name of your server"

returns the right server information.


Miguel Lagos
MiguelLagos
Lurker
 
Posts: 2
Liked: never
Joined: Fri Apr 07, 2017 12:37 am
Full Name: Miguel Angel Lagos

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby v.Eremin » Tue Jul 11, 2017 1:38 pm

What virtual platform you're using? VMware or Hyper-V one?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby KMeli » Tue Jul 11, 2017 6:54 pm

Hi I am on VM platform Thank you
KMeli
Novice
 
Posts: 3
Liked: never
Joined: Thu Apr 13, 2017 4:27 pm
Full Name: Karen Meli

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby KMeli » Tue Jul 11, 2017 8:37 pm

Miguel Lagos

Thank you!!!!!!!!
KMeli
Novice
 
Posts: 3
Liked: never
Joined: Thu Apr 13, 2017 4:27 pm
Full Name: Karen Meli

[MERGED] Retention Policy issues...

Veeam Logoby r.castello » Wed Jul 12, 2017 10:39 am

Hi,

I'm facing the same issue with retention policy.
We have 2 Vmware clusters "Cluster1" and "Cluster2". Cluster 1 is licensed to use with Veeam and I was trying to use https://www.veeam.com/blog/es-lat/veeam-backup-free-edition-now-with-powershell.html for Cluster2.

Everything is working fine except Retention, this is set to "Tonight" for testing and backups are not deleted. This backups are stored locally on the machine where Veeam runs, so i think is not a permission problem.

We use Veeam Backup&Replication 9.5 Update 2

Code: Select all
Author: Vladimir Eremin
# Created Date: 3/24/2015
# http://forums.veeam.com/member31097.html
#

##################################################################
#                   User Defined Variables
##################################################################

# Names of VMs to backup separated by comma (Mandatory). For instance, $VMNames = “VM1”,”VM2”
$VMNames = "Machine1","Machine2"

# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
$HostName = "vcenter.XXXXXX.XX"

# Directory that VM backups should go to (Mandatory; for instance, C:\Backup)
$Directory = "D:\VeeamBackup"

# Desired compression level (Optional; Possible values: 0 - None, 4 - Dedupe-friendly, 5 - Optimal, 6 - High, 9 - Extreme)
$CompressionLevel = "5"

# Quiesce VM when taking snapshot (Optional; VMware Tools are required; Possible values: $True/$False)
$EnableQuiescence = $True

# Protect resulting backup with encryption key (Optional; $True/$False)
$EnableEncryption = $False

# Encryption Key (Optional; path to a secure string)
$EncryptionKey = ""

# Retention settings (Optional; By default, VeeamZIP files are not removed and kept in the specified location for an indefinite period of time.
# Possible values: Never , Tonight, TomorrowNight, In3days, In1Week, In2Weeks, In1Month)
$Retention = "Tonight"

##################################################################
#                   Notification Settings
##################################################################

# Enable notification (Optional)
$EnableNotification = $false

# Email SMTP server
$SMTPServer = ""

# Email FROM
$EmailFrom = ""

# Email TO
$EmailTo = ""

# Email subject
$EmailSubject = ""

##################################################################
#                   Email formatting
##################################################################

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"

##################################################################
#                   End User Defined Variables
##################################################################

#################### DO NOT MODIFY PAST THIS LINE ################
Asnp VeeamPSSnapin

$Server = Get-VBRServer -name $HostName
$MesssagyBody = @()

foreach ($VMName in $VMNames)
{
  $VM = Find-VBRViEntity -Name $VMName -Server $Server
 
  If ($EnableEncryption)
  {
    $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | ConvertTo-SecureString)
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey
  }
 
  Else
  {
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention
  }
 
  If ($EnableNotification)
  {
    $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
    $FailedSessions =  $TaskSessions | where {$_.status -eq "EWarning" -or $_.Status -eq "EFailed"}
 
  if ($FailedSessions -ne $Null)
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={$FailedSessions.Title}})
  }
   
  Else
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={($TaskSessions | sort creationtime -Descending | select -first 1).Title}})
  }
 
  }   
}
If ($EnableNotification)
{
$Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
$Message.Subject = $EmailSubject
$Message.IsBodyHTML = $True
$message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
$SMTP = New-Object Net.Mail.SmtpClient($SMTPServer)
$SMTP.Send($Message)
}

r.castello
Novice
 
Posts: 3
Liked: never
Joined: Wed Jul 12, 2017 10:31 am
Full Name: Ruben

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby v.Eremin » Wed Jul 12, 2017 12:57 pm

Hi I am on VM platform Thank you

Then, you need to leverage VMware version of the script, currently you're using Hyper-V one. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby v.Eremin » Wed Jul 12, 2017 12:58 pm

Everything is working fine except Retention, this is set to "Tonight" for testing and backups are not deleted.

Can you try to reproduce the issue via GUI and provide me with the results of your findings?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby r.castello » Thu Jul 13, 2017 8:34 am

v.Eremin wrote:Can you try to reproduce the issue via GUI and provide me with the results of your findings?


I made 2 VeeamZip yesterday, one with GUI and the other one with powershell. Today it worked greated, maybe I made some mistakes on the first attempt, so sorry.

Just a little question more, the folder specified("D:\VeeamBackup") on both (GUI and powershell ) got deleted, there is no folder now. In the folder there were only the VeeamZip files so after retention it was empty, but I'm surprised folder is deleted too. Is this the normal behaviour?

Thanks and sorry again, this is amazing script!
r.castello
Novice
 
Posts: 3
Liked: never
Joined: Wed Jul 12, 2017 10:31 am
Full Name: Ruben

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby v.Eremin » Thu Jul 13, 2017 9:25 am

The folder should stay intact, actually.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Start-VBRZip in Veeam Backup Free Edition

Veeam Logoby CRKeo » Tue Jul 18, 2017 2:50 pm

Hi,

Using the script posted on the website with no issues but I was wondering if there was a way I could read in all the VMs I want to backup from a text file rather than specify them individually in the script? Did give it a quick try with Get-Content but didn't seem to work, could just be me though getting it wrong.

Thanks
CRKeo
Lurker
 
Posts: 2
Liked: never
Joined: Tue Nov 15, 2016 3:25 pm

excluding specific vhdx

Veeam Logoby hawkeye871 » Tue Aug 01, 2017 5:37 am

Hello.
I use Veeam Backup & replication for Hyper-V 9.5 free edition with the standart Power Shell script. With this script i can specify VMs that i want to back up, VMs have a couple of vhdx disk but i need to exclude one of vhdx. How can i establish it via Power Shell? Thanks.
hawkeye871
Lurker
 
Posts: 1
Liked: never
Joined: Mon Jul 31, 2017 12:03 pm

[MERGED] Start-VBRZip with retention

Veeam Logoby proactis » Wed Aug 02, 2017 9:21 am

I have create a very simple powershell script as a test to backup for now but it seems to ignore the -AutoDelete and seems to delete the day after. Is there a way of seeing what veema has issued to the zip backup as retention policy

$VM = "Server1"
$BackupPath = "E:\backup\"
Start-VBRZip -Entity $VM -Folder $BackupPath -Compression 9 -AutoDelete In3Days
proactis
Lurker
 
Posts: 1
Liked: never
Joined: Tue Jun 14, 2011 9:41 am

PreviousNext

Return to PowerShell



Who is online

Users browsing this forum: Google [Bot] and 4 guests