LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2008, 02:01 PM   #1
linuxbee1
LQ Newbie
 
Registered: Mar 2008
Posts: 22

Rep: Reputation: 15
Rsync error cannot do ssh and transfer file


Hi,

I am trying to transfer a folder from one machine to another machine using ssh and rsync. I doing rsync has root. I am getting the following rsync error.

rsync: Failed to exec /var/lib/postgresql/7.4/: Permission denied (13)
rsync error: error in IPC code (code 14) at pipe.c(83)
rsync: writefd_unbuffered failed to write 4 bytes: phase "unknown" [sender]: Broken pipe (32)
rsync error: error in rsync protocol data stream (code 12) at io.c(1099)

I tried changing the file permissions too...
 
Old 06-23-2008, 03:32 PM   #2
LiamFromLeeds
Member
 
Registered: Dec 2006
Distribution: Arch
Posts: 44

Rep: Reputation: 15
Could you post your rsync command? The permission error could be on the source system or the target system
 
Old 06-23-2008, 03:37 PM   #3
linuxbee1
LQ Newbie
 
Registered: Mar 2008
Posts: 22

Original Poster
Rep: Reputation: 15
My rsync code:

rsync -av -e /var/lib/postgresql/7.4/ ssh root@<ip address>:/var/lib/postgresql/7.4/

Last edited by linuxbee1; 06-23-2008 at 03:39 PM.
 
Old 06-23-2008, 03:49 PM   #4
LiamFromLeeds
Member
 
Registered: Dec 2006
Distribution: Arch
Posts: 44

Rep: Reputation: 15
Are you running as root on the source machine? Is /var/lib/postgresql/7.4 a network share on either the source or target machine (that can cause problems if running as root)?
 
Old 06-23-2008, 03:52 PM   #5
LiamFromLeeds
Member
 
Registered: Dec 2006
Distribution: Arch
Posts: 44

Rep: Reputation: 15
Is your 'ssh' in the right place ? Should it be ...

Code:
rsync -av -e ssh /var/lib/postgresql/7.4/ root@<ip address>:/var/lib/postgresql/7.4/
 
Old 06-23-2008, 04:07 PM   #6
linuxbee1
LQ Newbie
 
Registered: Mar 2008
Posts: 22

Original Poster
Rep: Reputation: 15
ssh is in the right place. I am doing ssh on the source machine to connect to the target machine.
 
Old 06-23-2008, 04:08 PM   #7
LiamFromLeeds
Member
 
Registered: Dec 2006
Distribution: Arch
Posts: 44

Rep: Reputation: 15
Are you logged in as root on the source machine ?
 
Old 06-23-2008, 04:12 PM   #8
linuxbee1
LQ Newbie
 
Registered: Mar 2008
Posts: 22

Original Poster
Rep: Reputation: 15
No. I am not logged in as root on the sourse machine. I am accessing target machine as root.
 
Old 06-23-2008, 04:18 PM   #9
LiamFromLeeds
Member
 
Registered: Dec 2006
Distribution: Arch
Posts: 44

Rep: Reputation: 15
So could the permission denied error be "read" permission on the source machine then? What does the following return on the source machine?

Code:
ls -l /var/lib/postgresql/7.4/
 
Old 06-23-2008, 04:19 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by linuxbee1 View Post
ssh is in the right place. I am doing ssh on the source machine to connect to the target machine.
What Liam means is that "ssh" should immediately follow tha "-e" option - you are trying to use the "/var/lib/....." as the remote shell
 
Old 06-23-2008, 04:20 PM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by linuxbee1 View Post
No. I am not logged in as root on the sourse machine. I am accessing target machine as root.
Does your user have read access to the postgresql files?
 
Old 06-23-2008, 04:27 PM   #12
linuxbee1
LQ Newbie
 
Registered: Mar 2008
Posts: 22

Original Poster
Rep: Reputation: 15
Yes. It has read access. I changed the user permission.
 
Old 06-23-2008, 04:39 PM   #13
LiamFromLeeds
Member
 
Registered: Dec 2006
Distribution: Arch
Posts: 44

Rep: Reputation: 15
I definitly think your command is wrong and you need to rewrite it as I suggested earlier to ..

Code:
rsync -av -e ssh /var/lib/postgresql/7.4/ root@<ip address>:/var/lib/postgresql/7.4/
If you man ssh you'll see an example ..

Code:
 rsync -az -e ssh ~ftp/pub/samba/ nimbus:"~ftp/pub/tridge/samba"
The important thing is that "ssh" follows the "-e". This is telling rysnc to use the ssh protocol for the connection. Note in the example the source target is local and specified first and the remote target is specified second, just as you want.

I think the other clue is that your error is "failed to exec". Its trying to run /var/lib/postgresql/7.4 because you've told rsync this is the shell you want to use
 
Old 06-23-2008, 04:41 PM   #14
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by linuxbee1 View Post
Yes. It has read access. I changed the user permission.
Have you addressed the 3 -e comments yet?
 
  


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
file time stamp is wrong with ssh file transfer cy163 Linux - Newbie 8 05-18-2008 01:40 AM
file transfer over ssh? jme Linux - Software 5 11-13-2006 01:30 AM
SSH File transfer wjeanpaul Linux - General 19 02-07-2006 02:34 PM
File transfer with SSH? Baix Linux - Newbie 5 01-28-2005 06:24 PM
ssh file transfer? Apostasy Linux - Newbie 11 07-30-2004 10:33 PM


All times are GMT -5. The time now is 03:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration