LinuxQuestions.org
Help answer threads with 0 replies.
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 07-28-2008, 01:49 PM   #1
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Rep: Reputation: 15
Rsync problem: command not found


I am trying to run a simple rsync job on RHES4 but keep getting a command not found error. The job is this:

rsync -r <my user>@<my server>:/home/myuser/ /batch/

This is the error message:

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)


I have tried feeding it the rsync path with --rsync-path=/usr/bin/rsync but still not luck. Ideas?
 
Old 07-28-2008, 02:13 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
How about just placing the full path to the executable:

/usr/bin/rsync -r <my user>@<my server>:/home/myuser/ /batch/

And you might want to put /usr/bin in your users path, this is a common place for most executables you'll end up running anyways. I find it strange it's not already in your path, unless you don't have rsync installed.
 
Old 07-28-2008, 02:17 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
that looks like rsync is not installed on the remote server. is it?
 
Old 07-28-2008, 02:27 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by AlucardZero View Post
that looks like rsync is not installed on the remote server. is it?
To my knowledge rsync doesn't need to be on the remote machine since by default it will use the ssh protocol.
 
Old 07-28-2008, 02:33 PM   #5
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Original Poster
Rep: Reputation: 15
I tried this but I get the same error:

/usr/bin/rsync -r <my user>@<my server>:/home/myuser/ /batch/

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)


Rsync is on my server:
which rsync
/usr/bin/rsync


It is not on the remote server, but as trickykid stated, my understanding was that it did not need to be.
 
Old 07-28-2008, 02:37 PM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by j_70 View Post
I tried this but I get the same error:

/usr/bin/rsync -r <my user>@<my server>:/home/myuser/ /batch/

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)


Rsync is on my server:
which rsync
/usr/bin/rsync


It is not on the remote server, but as trickykid stated, my understanding was that it did not need to be.
Maybe it's trying to use rsync on the remote server as well. Try adding a -e ssh in the command like this:

/usr/bin/rsync -r -e ssh <my user>@<my server>:/home/myuser/ /batch/
 
Old 07-28-2008, 02:41 PM   #7
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Original Poster
Rep: Reputation: 15
Hmmm. Same error. Maybe it does need to be installed on the remote server?
 
Old 07-28-2008, 02:54 PM   #8
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by j_70 View Post
Hmmm. Same error. Maybe it does need to be installed on the remote server?
Hmm.. I just tested without and got the same error. I'm guessing rsync is needed on remote destination machine in order to carry out the copy. I could have sworn in the past or previous versions it wasn't necessary, but then again, I always have rsync installed on all Linux machines I administer.
 
Old 07-28-2008, 02:58 PM   #9
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Original Poster
Rep: Reputation: 15
Seems to be. This is going to Windowz over SSH so I was hoping that I could just use rsync to copy only new files over. Does SCP have an rsync-like option to only copy new files?
 
Old 07-28-2008, 03:01 PM   #10
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
Wait, you're trying to go from Linux to Windows? SCP does not to my knowledge have rsync type capabilities and will overwrite existing files, etc.
 
Old 07-28-2008, 03:13 PM   #11
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Original Poster
Rep: Reputation: 15
Yes (unfortunately) Linux -> Windoze. I read some information on the Samba / rsync list that this was possible, if ssh was set up. Apparently not, however. Maybe rdiff will work.
 
Old 07-28-2008, 04:00 PM   #12
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by j_70 View Post
Yes (unfortunately) Linux -> Windoze. I read some information on the Samba / rsync list that this was possible, if ssh was set up. Apparently not, however. Maybe rdiff will work.
The only time I've seen rsync work with Windows and or going to Windows is when I had sshd running in a cygwin instance. There might be a Windows SSH daemon but I've never dealt with it directly.
 
Old 07-28-2008, 08:27 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,904

Rep: Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614
This looks like what you want:
http://www.captain.at/howto-rsync-linux-windows.php
http://www.brentnorris.net/rsyncntdoc.html
 
Old 07-29-2008, 11:08 AM   #14
kenoshi
Member
 
Registered: Sep 2007
Location: SF Bay Area, CA
Distribution: CentOS, SLES 10+, RHEL 3+, Debian Sarge
Posts: 159

Rep: Reputation: 32
Just install cygwin on your windows box. Make sure the following are installed:

- All packages in admin
- unzip/zip from archive
- select vim in editors
- in Net, select openssh client/server, then rsync
- everything else default

Once cygwin is finished, open the cygwin bash shell, and run:

ssh-host-config

Say yes to everything and follow instructions to start the service.

Voila, you are all set. If you still get the same error, make sure you specify where rsync is remotely with the following option:

--rsync-path=<path to rsync on windows box>

Hope this helps.
 
1 members found this post helpful.
Old 11-26-2013, 09:56 AM   #15
alberto56
LQ Newbie
 
Registered: Nov 2013
Posts: 1

Rep: Reputation: Disabled
In my case I was trying to rsync from Mac OS to CentOS. rsync has to be installed on the remote box, but it is expected to be at /usr/sbin/rsync instead of /usr/bin/rsync. I just created a symlink on my remote machine:

ln -s /usr/bin/rsync /usr/sbin/rsync

Now rsync works
 
  


Reply


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
Logrotate problem - postrotate: command not found humbletech99 Linux - General 2 01-14-2007 10:49 AM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
Problem: Startx Command Not Found rvijay Debian 11 02-13-2005 11:40 AM
Command not found problem rudon Linux - Newbie 3 04-16-2003 09:09 PM
depmod -a :command not found. Sound problem Greenhorn Linux - Newbie 4 10-24-2002 10:32 PM

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

All times are GMT -5. The time now is 01:08 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