So far this process has worked well. I have a power-shell script that executes on the Linux machine and creates a remote ps-session to the Windows Server running VBR. That script executes the various "get-" commands to populate variables and ultimately executes Start-VBRLinuxFileRestore. Once that spins up I'm able to rsync from it without an issue. My problem comes at the next step. By the time the Linux rsync is done (takes about 3 hours) my remote ps-session has gone idle and I've lost the $LFR variable. Powershell acts like I'm still connected to the remote server, but $LFR returns null. I suspect what's happening is PS is reconnecting in the background.
I can still open the GUI and stop the LFR; however that is a manual process. I've been looking for a way to either store the LFR or get the LFR from a get-session or similar action so that I don't have to worry about the session becoming idle. This is an awesome process and if we can do this in a purely programmatic way it would be a perfect solution as we don't have to impact production to update test.
Code: Select all
Enter-PSSession -ComputerName ServerNameHere
Add-PSSnapin VeeamPSSnapin
Connect-VBRServer -Server ServerNameHere
$BackupJob = Get-VBRBackup -Name JobNameHere
$RestorePoint = (Get-VBRRestorePoint -Backup $BackupJob | Sort-Object –Property CreationTime –Descending | Select -First 1)
$server = Get-VBRServer -Name ServerNameHere
$network = (Get-VBRViServerNetworkInfo -Server $server | Where-Object {$_.NetworkName -eq "Managment Network"})
$Cred = (Get-VBRCredentials -name root |Sort-Object -Property ChangeTimeLocal -Descending | select -First 1)
$LFR = Start-VBRLinuxFileRestore -RestorePoint $RestorePoint -IP 172.16.25.147 -NetworkMask 255.255.255.0 -Gateway 172.16.25.254 -EnableFTP -Server $server -NetworkInfo $network -Credentials $Cred
./rsyncjob.sh
Stop-VBRLinuxFileRestore -LinuxFlrObject $LFR