LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-25-2009, 06:58 AM   #1
codenjanod
Member
 
Registered: Oct 2006
Posts: 38

Rep: Reputation: 15
Rsync gives an rsh error when running in a script


Hi all,

This is a strange error that I only get from my Mandrake machines.
My FreeBSD and CentOS servers work fine.
I believe my syntax is correct in my script as well.

I have 3 servers installed with:
Mandrake Linux release 9.2 (FiveStar)
Kernel 2.4.26-mdkmosixsmp

I run my rsync in a script, which looks as follows:
Code:
#!/bin/bash

VAULT='backupserver'
RSYNC=`which rsync`
DATE=$(date +%Y-%m-%d.%H:%M)
LOG="/tmp/Server1-$DATE.log"

$RSYNC -avl --delete --stats /usr/local/data root@$VAULT:/Backups/Server1 >> $LOG
When I run this script, all 3 servers give me the same error:
Quote:
Failed to exec rsh : No such file or directory
rsync error: error in IPC code (code 14) at pipe.c(82)
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(165)
My rsync is located in "/usr/bin/rsync" which is in my path.

I tried to run the command manually but I get the same errors.

Is it something I have to install ?

I do not know Mandrake very well, I actually am not even too sure how to install anything on Mandrake.


Thanks for the help.
 
Old 11-25-2009, 03:42 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
As per the man page:

Quote:
You can also specify any remote shell you like, either by using the -e
command line option, or by setting the RSYNC_RSH environment variable.
cheers
 
Old 11-25-2009, 08:55 PM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
rsync needs to use some remote shell to connect to remote machines. These days that is normally ssh by default, but is seems that on your installation it is trying to use rsh. As pointed out by kbp, you can choose which remote shell using the -e flag or RSYNC_RSH variable. For example to use ssh (which is probably what you want) do:

Code:
$RSYNC -e ssh -avl --delete --stats /usr/local/data root@$VAULT:/Backups/Server1 >> $LOG
Although, I don't recommend allowing root ssh access.

Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsh <hostname> <script path> giving permission denied error shad.ithbti Linux - Newbie 5 08-31-2009 07:55 AM
why am getting error ksh: syntax error: `fi' unexpected while running script deb4you Linux - Newbie 4 09-06-2008 08:37 AM
running mpd by rsh pierlu Fedora 0 10-18-2007 05:32 AM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 09:10 PM
RSH: remuser too long error when rsh is executed from IIS dev33445 Programming 0 08-29-2005 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration