LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Rsync error cannot do ssh and transfer file (https://www.linuxquestions.org/questions/linux-newbie-8/rsync-error-cannot-do-ssh-and-transfer-file-651106/)

linuxbee1 06-23-2008 02:01 PM

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...

LiamFromLeeds 06-23-2008 03:32 PM

Could you post your rsync command? The permission error could be on the source system or the target system

linuxbee1 06-23-2008 03:37 PM

My rsync code:

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

LiamFromLeeds 06-23-2008 03:49 PM

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)?

LiamFromLeeds 06-23-2008 03:52 PM

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/

linuxbee1 06-23-2008 04:07 PM

ssh is in the right place. I am doing ssh on the source machine to connect to the target machine.

LiamFromLeeds 06-23-2008 04:08 PM

Are you logged in as root on the source machine ?

linuxbee1 06-23-2008 04:12 PM

No. I am not logged in as root on the sourse machine. I am accessing target machine as root.

LiamFromLeeds 06-23-2008 04:18 PM

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/

billymayday 06-23-2008 04:19 PM

Quote:

Originally Posted by linuxbee1 (Post 3192993)
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

billymayday 06-23-2008 04:20 PM

Quote:

Originally Posted by linuxbee1 (Post 3193000)
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?

linuxbee1 06-23-2008 04:27 PM

Yes. It has read access. I changed the user permission.

LiamFromLeeds 06-23-2008 04:39 PM

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

billymayday 06-23-2008 04:41 PM

Quote:

Originally Posted by linuxbee1 (Post 3193015)
Yes. It has read access. I changed the user permission.

Have you addressed the 3 -e comments yet?


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