Comprehensive data protection for all workloads
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

How can run linux script for surebackup

Post by baber »

Dear all
Hi

My sure or replica backup work excellent just not used script
Now i want run check script for sure or replica backup on vm with linux os
My script is this
. db-env
sqlplus / sysdba
select status from v$instance;
database is open # this is output

Now how can run it and if show database is open
In veeam report in script part show succeed

BR
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

what do i have to do ?

i want my script execute remotely on my linux for sure backup and replica backup

BR
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

No one could not run a linux script execute remotely during sure backup??
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

nobody can not help ?

BR
tsightler
VP, Product Management
Posts: 6011
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: How can run linux script for surebackup

Post by tsightler »

You need to create some type of Windows script, either Powershell or batch or whatever, that calls some type of ssh client (probably putty) which connects to the Linux VM to run the script. I previously had an example, but calling putty is something like:

putty.exe -ssh <user>@<linux_ip> -pw <password> -m C:\scripts\linux_script

You're wrapper shell script can get the IP address passed from the Surebackup test and is documented in Veeam KB1312. When I have a little more time I'll try to put up a working example if you don't work it out by then but it may be a few days as I don't have much time right now.
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

so thanks
my script is ready and i put that in prevoius post when create job i know there is a part for use script that is contain 3 field:
1-Name
2- path
3-Argumants

ok in name field i put for example = test

in path i select that script written and is on veeam backup server in this path : c:\script\sure.sh

now is that your means in argument field had to write this :
putty.exe -ssh <user>@<linux_ip> -pw <password> -m C:\scripts\linux_script

just change user with root user and linux ip and change <password> with root password ?

also i read that KB but that is not complete and clear also is for windows

BR
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

i am waiting for your help

BR
Babak
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: How can run linux script for surebackup

Post by PTide »

Assume that you have two script files located on VBR: wrapper.bat and sure.sh.

In the "Path" field you should specify path to the wrapper.bat.
In the "Arguments" field specify %vm_ip%
%wrapper.bat should contain something like this:

Code: Select all

\path\to\putty.exe -ssh %vm_ip% -l user -pw password -m \path\to\sure.sh
Replace user and password with whatever will allow connection to that particular VM.
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

so thanks
1-but i just write one script with name sure.sh i don't have wrapper.bat script
2- what is your means from vmip? my ip adress of vm that i have get backup that is 10.10.50.67

BR
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

about question2 :
is that your means do i have to use from 10.10.50.67 instead of %vm_ip% ?
do i have to put ip address between %% or don't need use from %% ?

BR
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

1- my vm's ip that get backup from that is 10.10.50.67
2- create a bat file in windows and this is contain in bat file :

"C:\Program Files\Veeam\Backup and Replication\Backup\Putty"\putty.exe -ssh root@10.10.50.67 -pw password -m C:\Users\Administrator\Desktop\123\sure.sh

3- my production network connection is : 10.10.50.70 - 255.255.255.224 Gw= 10.10.50.65
now i don't know what do i have to write in argument filed

BR
Babak
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

can anyone help me?
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How can run linux script for surebackup

Post by tdewin » 1 person likes this post

%vm_ip% is an automatic parameter that will be filled in when you put it in the argument field in backup & replication and will be the external address of the VM that is in the lab environment
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

is that your means in argument field just write %vm_ip% or have to write ip address ?????

BR
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How can run linux script for surebackup

Post by tdewin »

it's a dynamic parameter that will be filled in automatically so you write %vm_ip%
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

it won't correctly
my 1.bat script is :

"C:\Program Files\Veeam\Backup and Replication\Backup\Putty"\putty.exe -ssh root@172.20.68.74 -pw password -m C:\Script\sure.sh

and my sure.sh is :

#!/bin/bash
mkdir -p /tmp/surerplicaaaaaasssssaaaaaaa

and in argument field write : %vm_ip%

but it don't succeed and more than 20min that show in progress in script part checking heartbeat and ping success what is my problem ?


see picture

https://pasteboard.co/H5dfP8d.jpg
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

can anyone help me plz?

BR
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How can run linux script for surebackup

Post by tdewin »

In veeam you pass the parameter %vm_ip% to your bat script

In your bat script, you can use that parameter as %1 I believe (http://www.robvanderwoude.com/parameters.php) because it is passed as the first argument. So you should be able to do something like

Code: Select all

"C:\path\to\putty\putty.exe" -ssh root@%1
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

is that necessary use %vm_ip% in argument field ? and the other question is why that stop in progress more that 30min?

BR
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How can run linux script for surebackup

Post by tdewin »

no, you can just remove the %vm_ip% and put a fixed ip in the batch script. But make sure to put the masked IP and not the production IP, so your script is not connecting to your production server
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

what is my masq ip in below pic ?

https://pasteboard.co/H5ne43k.jpg

BR
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: How can run linux script for surebackup

Post by PTide »

just replace the second octet of your production IP with 29. For example, assume that your VMs production IP is 172.20.X.Y, then your masquerade IP will be 172.29.X.Y

Thanks
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

thanks
but you said put the masked IP and not the production IP in bat script file now what ip adress do i have to put in bat file ?

BR
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: How can run linux script for surebackup

Post by PTide »

You should put the masquerade IP in the .bat file. If you put production IP, then the script will attempt to connect to the production VM, which is clearly not what you want.

Thanks
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

PTide wrote:You should put the masquerade IP in the .bat file. If you put production IP, then the script will attempt to connect to the production VM, which is clearly not what you want.

Thanks
ok

i understand your means but now want to know according that pic my msq ip address is : 172.29.C.D

now what ip address do i have to put in .bat file ?
what is my masquerade IP ?

BR
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: How can run linux script for surebackup

Post by PTide »

172.29.C.D is a template for IP masquerading. That is, if your production VM has IP 172.20.68.10, then its corresponding masquerade IP would be 172.29.68.10. If some other VM has, for example, IP 172.20.50.12, then the masquerade IP would be 172.29.50.12, and so on. Please check this example.

Thanks
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

thanks
but when i changed my masq ip appear this error : my producion vm ip is : 172.20 68.74 255.255.255.224 172.20.68.65

[img]
https://pasteboard.co/H5tmsUc.jpg
[/img]
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: How can run linux script for surebackup

Post by PTide »

You should not replace the letters in IP address in the wizard. "C" and "D" represent corresponding octets of your production IP addresses, they will be substituted with proper values automatically depending on the IP. Provided that you have three VMs in production, it will work as follows:

|_VM__| ProductionIP | Masqu.___IP |

|_VM1_| 172.20.68.10 | 172.29.68.10 |
|_VM2_| 172.20.68.11 | 172.29.68.11 |
|_VM3_| 172.20.70.12 | 172.29.70.12 |

Thanks
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

thanks but confused
please see my config :

my virtual lab proxy setting is this

https://pasteboard.co/H5tPGX0.jpg

my isolated config in virtual lab is :

https://pasteboard.co/H5tQMAH.jpg

and my network setting in virtual lab is :

https://pasteboard.co/H5tRnc8.jpg

and this is my script that i put it in surebackup job

and this is my .bat script but another can not success for script and wait in progress what is the problem?

"C:\Program Files\Veeam\Backup and Replication\Backup\Putty"\putty.exe -ssh root@172.31.255.224 -pw password -m C:\Script\sure.sh

https://pasteboard.co/H5u4ymP.jpg

but i can not ping 172.31.255.224

and in vcenter just have 2vms:

1-bakaml_da43472f8ff145318f0022919918914c with ip = 172.20.68.74
2- Virtual_Labamlscript with ip = 172.20.68.68

and don't have any vm with ip 172.31.255.224
BR
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: How can run linux script for surebackup

Post by baber »

my masq ip now is 172.31.C.D
and when i run job this ip has ping and could ssh to that 172.31.68.74 but my problem is script not run via sure replica job
i am sure .bat file is correct because when i run 1.bat file it will connect to 172.31.68.74 and run sure.sh script

do i have to just add script in sure backup job or also have to use that when create application group ?

BR
Post Reply

Who is online

Users browsing this forum: No registered users and 175 guests