Rsync over ssh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Rsync over ssh
# 1  
Old 01-27-2018
Rsync over ssh

Hi UnixGurus

Could you please help me with the below scenario.

Code:
SERVER1=abc.ins.com
SERVER2=exy.ins.com
PATH=/home/oracle/backup/
USER=oracle

I want to sync $PATH from $SERVER1 to $SERVER2. I used the below command and run the command from $SERVER1
Code:
/usr/bin/rsync -arv -e ssh $PATH $USER@$SERVER2:/$PATH

Here I faced the below problem.

$SERVER2 has login profile to list all applications (directories) and prompts the user to select from it.

$SERVER2 login profile ("select" command in the profile) sample output:
Code:
Welcome to exy.ins.com

1) APP1
2) APP2
3) APP3
4) APP4
5) APP5
6) APP6
7) APP7
#? 1

When I run RSYNC command I am getting the below error;

Code:
tput: No value for $TERM and no -T specified
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(171) [sender=3.0.6]

When I updated login profile in $SERVER2 (commented out "select" command), the RSYNC command works fine.

Is there any way to make RSYNC work from $SERVER1 without making any changes to $SERVER2 profile? (Any option to supply for not to invoke $SERVER2 login profile using RSYNC)

Last edited by Don Cragun; 01-27-2018 at 02:19 AM.. Reason: Add CODE and ICODE tags.
# 2  
Old 01-27-2018
If your shell (which, btw, you fail to mention) provides the -i option flag, you could evaluate that (with ?-) and skip the select command.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

3. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

4. Shell Programming and Scripting

Rsync from remote machine via ssh and sync by uisng find by modified time

Hi I have a requirement to rsync from remote to local machine via ssh and sync files that are changed in last n hours. pgrep to check if no other sync is running pgrep -f rsync.*/opt > /dev/null || rsync --bwlimit=10000 -avz --delete root@X.X.X.X:/var/source/ /opt/dest/ >> /home/log 2>&1... (0 Replies)
Discussion started by: robo
0 Replies

5. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

6. OS X (Apple)

rsync and ssh keys help

Not specifically a mac question, but it's what I am using. I am setting up some replication for some file shares using rsync. The problem is that I am being given a little bit of a twist - I'm supposed to use a non-admin account to do it with. I have 2 boxes - Master and Slave with 1... (2 Replies)
Discussion started by: kleinboy
2 Replies

7. Solaris

rsync via ssh Problem

Hi all, recently I took over the admin-task for a solaris 10 x86 machine. I would like to use rsync for backing up files via ssh to another machine. There are two machines I have tested with both without success. One is a ubuntu server 8.04, the other one is ubuntu 10.04 desktop. Installed... (2 Replies)
Discussion started by: sly_dunbar
2 Replies

8. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

9. UNIX for Dummies Questions & Answers

Problems using rsync in Leopard with SSH... seeking solution/alternative

Precursor: ...it may sound like I'm at least somewhat comfortable with Unix, but I'm far from it. Layman's terms would be greatly appreciated :) Okay, so here's the situation. I created a website using iWeb, and I'm not using a .Mac account (you can sync website in one click if you do). Being... (4 Replies)
Discussion started by: compulsiveguile
4 Replies
Login or Register to Ask a Question