Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 11-25-2009, 07:58 AM   #1
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:

RSYNC=`which rsync`
DATE=$(date +%Y-%m-%d.%H:%M)

$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:
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, 04:42 PM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

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

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.
Old 11-25-2009, 09:55 PM   #3
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286Reputation: 1286
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:

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:55 AM
why am getting error ksh: syntax error: `fi' unexpected while running script deb4you Linux - Newbie 4 09-06-2008 09:37 AM
running mpd by rsh pierlu Fedora 0 10-18-2007 06:32 AM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 10:10 PM
RSH: remuser too long error when rsh is executed from IIS dev33445 Programming 0 08-29-2005 10:34 AM

All times are GMT -5. The time now is 07:56 PM.

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