PowerShell script exchange
Post Reply
Jocelyn32
Novice
Posts: 7
Liked: 1 time
Joined: Mar 22, 2016 8:49 am
Contact:

Restoring multiple files with Guest files (Linux)

Post by Jocelyn32 »

Hello,

I would like to transfer (restore) files from one backup to another server.
These are RedHat servers
Here is the beginning of my script:

Can you help me understand how to specify which files I want to restore?
And how do you choose to restore to another server?

Thank You !
Jocelyn32
Novice
Posts: 7
Liked: 1 time
Joined: Mar 22, 2016 8:49 am
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by Jocelyn32 »

Sorry I have forget the start code :

Code: Select all

$esx = Get-VBRServer -Name "esx3.local"
Find-VBRViResourcePool -Server $esx
$resourcepool = Get-VBRServer -Name "esx3.local" | Find-VBRViResourcePool
$targetnetwork = Get-VBRViServerNetworkInfo -Server "esx3.local" | Where-Object { $_.NetworkName -eq "Default_VLAN" }
$restorepoint = Get-VBRBackup -Name "VM_Linux" | Get-VBRRestorePoint -Name "Oracle" | Sort Creationtime -Descending | Select -First 1
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by veremin »

I think this is the algorithm you should script:

- Power on Linux FLR appliance, using the code provided (Veeam PS)
- Enable FTP access to the restored file system (Veeam PS)
- Copy and paste files from disk mounted to the appliance, using whatever 3-party tool (supporting FTP) that you want to (3-party tool)


Thanks.
Jocelyn32
Novice
Posts: 7
Liked: 1 time
Joined: Mar 22, 2016 8:49 am
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by Jocelyn32 »

Thanks !

Do you have an example to enable ftp access ?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by veremin »

Yep, it's -EnableFTP switch that does that. Thanks.
tsightler
VP, Product Management
Posts: 6009
Liked: 2842 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by tsightler »

Note that you can also use SCP and or Rsync, but you will need to know the password for the appliance, which you can set in credentials manager, or via Powershell.
Jocelyn32
Novice
Posts: 7
Liked: 1 time
Joined: Mar 22, 2016 8:49 am
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by Jocelyn32 »

Thanks !

I start the tests but how to have a fixed ip with the virtual lab ?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by veremin »

You can set a static IP for Linux FLR appliance once, using either this wizard or -IPAddress parameter of Start-VBRLinuxFilerRestore cmdlet, and leverage it as a connection point afterwards. Thanks.
Jocelyn32
Novice
Posts: 7
Liked: 1 time
Joined: Mar 22, 2016 8:49 am
Contact:

Re: Restoring multiple files with Guest files (Linux)

Post by Jocelyn32 » 1 person likes this post

Thanks, I will wait for the next request from the developers for a real test.

So I use two scripts:
A powershell script to start LFR
A bash script to transfer my files to FTP

Code: Select all

Add-PsSnapIn VeeamPSSnapIn -ErrorAction SilentlyContinue
$esx = Get-VBRServer -Name "esx3.local"
Find-VBRViResourcePool -Server $esx
$resourcepool = Get-VBRServer -Name "esx3.local" | Find-VBRViResourcePool
$targetnetwork = Get-VBRViServerNetworkInfo -Server "esx3.local" | Where-Object { $_.NetworkName -eq "Default_VLAN" }
$restorepoint = Get-VBRBackup -Name "VM_Linux" | Get-VBRRestorePoint -Name "Oracle" | Sort Creationtime -Descending | Select -First 1
$ipaddress = "192.168.1.24"
$networkmask = "255.255.255.0"
$gateway = "192.168.1.254"

$linuxflr = Start-VBRLinuxFileRestore -RestorePoint $restorepoint -Server $esx -ResourcePool $resourcepool -NetworkInfo $targetnetwork -IP $ipaddress -NetworkMask $networkmask -Gateway $gateway -EnableFTP

Code: Select all

#!/bin/sh

ftp -n 10.20.1.24
user root password
lcd /home/oracle/oracle11/oradata/gnx/
cd /VG_0-LV_home/oracle/oracle11/oradata/gnx
prompt
bin
get redo1.log
get redo2.log
get CONTROL03.CTL
bye
Post Reply

Who is online

Users browsing this forum: Max93 and 23 guests