I’m trying to rsync two folders between CentOS 7 and QNAP without using a password with cron.
What seemed to be a relatively straightforward process, turned out to be not as easy as expected.
Although I’ve managed to setup ssh correctly, I can’t get rsync to work in the same way.
ssh admin@server.example.com connects to the QNAP without password.
rsync -av /myfolder rsync://admin@server.example.com:/BACKUP/myfolder/ works but requires a password.
Using
rsync -av /myfolder admin@server.example.com:/BACKUP/myfolder/
returns:
sending incremental file list
rsync: mkdir "/BACKUP/server.example.com” failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(871) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
CentOS is using root (after su over ssh with other user)
QNAP user is admin
Obviously I am missing something, but have no clue.
Any help appreciated.
SSH key working for ssh, not for rsync
Re: SSH key working for ssh, not for rsync
rsync -av /myfolder rsync://admin@server.example.com:/BACKUP/myfolder/
will use the rsync daemon. For ssh rsync you want:
rsync -av /myfolder admin@server.example.com:/BACKUP/myfolder/
will use the rsync daemon. For ssh rsync you want:
rsync -av /myfolder admin@server.example.com:/BACKUP/myfolder/
-
- Posts: 4
- Joined: 2015/06/19 21:26:02
Re: SSH key working for ssh, not for rsync
Thx for the reply.
That was exactly what I've tried earlier and gave me following error:
rsync: mkdir "/BACKUP/server.example.com” failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(871) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9][/i]
However, trying again to run the same command gave me the following error:
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/BACKUP/server.example.com/backup/filename.zip": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
rsync: connection unexpectedly closed (31 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
As my storage capability was more then sufficient, I've discovered that I was trying to copy to the wrong location on the QNAP.
I've changed the command to:
rsync -av /myfolder admin@server.example.com://share/BACKUP/myfolder/
and it worked.
It is still unclear to me why it gave another error before.
Anyway, thx for your help.
That was exactly what I've tried earlier and gave me following error:
rsync: mkdir "/BACKUP/server.example.com” failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(871) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9][/i]
However, trying again to run the same command gave me the following error:
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/BACKUP/server.example.com/backup/filename.zip": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
rsync: connection unexpectedly closed (31 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
As my storage capability was more then sufficient, I've discovered that I was trying to copy to the wrong location on the QNAP.
I've changed the command to:
rsync -av /myfolder admin@server.example.com://share/BACKUP/myfolder/
and it worked.
It is still unclear to me why it gave another error before.
Anyway, thx for your help.