Setting up Rsync Server

Running 13.2 on x86-64bit machine with KDE 4.14.5 destop. I want to restore my multimedia files to this machine from a Qnap NAS box. The NAs box has a facility for running rsync to copy to a remote directory but states:-

You must enable Rsync server on the remote machine in order to use this function

Please could somebody advise how I should do this.
Budgie2

Sounds odd that it couldn’t take backups via rsync+ssh - could you give us the name of the box so we can look at the docs quickly to see if it supports rsync over ssh.

Hi Miuku,
Sorry, the NAS is a Qnap TS 559 Pro II. I am trying to restore from the NAS to my main machine. To do this I have to have rsync server running on said main machine and I suspect I do not have rsyncd.conf correct. It is as follows:-

gid = users
read only = true
use chroot = true
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
# hosts allow = trusted.hosts
slp refresh = 300
use slp = false

#[Example]
        path = /data/mastermedia
#       comment = An Example
#       auth users = alastair
#       secrets file = /etc/rsyncd.secrets

I know this is not secure but I have been paring it down to try and get connection. The NAS does see the srever and when I try the test button it says “success” but I cannot then establish a working connection.

Please let me know if you need more info.
Budgie2

Well I can see you have read only enabled there, how about you try this;


gid = users
read only = false
use chroot = false
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
slp refresh = 300
use slp = false

[backup]
        path = /data/mastermedia
        comment = NAS restore location
        gid = users
        uid = nobody
        list = yes


Make sure /data/mastermedia is readable, writable and executable by the users group. I’m guessing the box allows setting what share it tries to contact? That would be backup in this case, so the output for clients would be rsync://server.ip/backup

man rsync says:

Rsync refers to the local side as the “client” and the remote side as the “server”. Don’t confuse “server” with an rsync daemon – a daemon is always a server, but a server can be either a daemon or a remote-shell spawned process.

Does your NAS box simply require rsync to be running on the ‘remote side’ rather than on the ‘local side’ (ie the NAS box)?

Hi John,
Been off this for a few days so thanks for the reply. The answer I believe is yes. I am making progress however thanks to Miuku and will give more info in my reply to his post.

Hi Miuku,
Well that got things moving and most of what I wish to restore is now on my local machine but there were plenty of errors and I shall quote from the logs:-

2015/03/06 17:20:01 [26386] Unknown Parameter encountered: “use slp”
2015/03/06 17:20:01 [26386] IGNORING unknown parameter “use slp”
2015/03/06 17:20:01 [26386] rsyncd version 3.1.1 starting, listening on port 873
2015/03/06 17:20:01 [26386] Unknown Parameter encountered: “use slp”
2015/03/06 17:20:01 [26386] IGNORING unknown parameter “use slp”
2015/03/06 17:20:01 [26386] rsyncd registering 0 services with slpd for 300 seconds:
2015/03/06 17:22:37 [26405] Unknown Parameter encountered: “use slp”
2015/03/06 17:22:37 [26405] IGNORING unknown parameter “use slp”
2015/03/06 17:22:37 [26405] name lookup failed for 192.168.169.162: Name or service not known
2015/03/06 17:22:37 [26405] connect from UNKNOWN (192.168.169.162)
2015/03/06 17:22:37 [26405] module-list request from UNKNOWN (192.168.169.162)

Very many lines like this and then there was another glitch:

2015/03/06 23:22:03 [28819] IGNORING unknown parameter “use slp”
2015/03/06 23:22:03 [28819] name lookup failed for 192.168.169.162: Name or service not known
2015/03/06 23:22:03 [28819] connect from UNKNOWN (192.168.169.162)
2015/03/06 23:22:03 [28818] name lookup failed for 192.168.169.162: Name or service not known
2015/03/06 23:22:03 [28818] connect from UNKNOWN (192.168.169.162)
2015/03/06 23:22:03 [28819] rsync to restore/.rsyncSpeedTest@ from UNKNOWN (192.168.169.162)
2015/03/06 23:22:03 [28819] receiving file list
2015/03/06 23:22:03 [28818] rsync to restore/ from UNKNOWN (192.168.169.162)
2015/03/06 23:22:03 [28818] receiving file list
2015/03/06 23:22:03 [28818] rsync: chgrp “.rsyncSpeedTest@” (in restore) failed: Operation not permitted (1)
2015/03/06 23:22:03 [28818] sent 105 bytes received 68 bytes total size 0
2015/03/06 23:22:08 [28822] Unknown Parameter encountered: “use slp”
2015/03/06 23:22:08 [28822] IGNORING unknown parameter “use slp”

Any idea how to resolve these issues?

Budgie2

Just remove the slp configuration parameter and restart your rsyncd.

The chgrp looks like the NAS is trying to test for speeds using a groupname that does not exist, I wouldn’t worry about that.

Hi and thanks. I guessed this was the first thing to try and it is runing as I type. A couple of TB to sync so it takes a while.
The nightmares of this exercise are the additional hidden directories added both by the rsync process but worse, by the NAS. These are causing problems and I shall report on this at the end of this run.

My problem is that after restoring my master multimedia files on my workstation I shall add to them on an almost daily basis. My practice has been that once I am satisfied the new files are OK and tagged correctly, I would then rsync them back to the NAS with the instruction to delete superseded files on the NAS. Clearly the NAS added stuff mentioned above is not required in my master multimedia directories and if not ignored and inadvertently written back to the NAS will overwrite the latter and newer NAS.

If I get this wrong I could lose the lot but there are far too many to do it by directory.

Will let you know how this restore has gone as soon as completed. Once I have the restore right I can look into the rsyncing it back.

PS. Just checked and process failed. The biggest issue is that when rsync tries to creat a directory on workstation permission is refused.
This is true for the unwanted hidden .@__thumb directories but more importantly for the wanted program material which I have uploaded directly onto the NAS and I now want in my up to date master files.

Here are a few lines to indicate the problem:

2015/03/10 16:46:29 [26495] rsyncd version 3.1.1 starting, listening on port 873
2015/03/10 16:46:29 [26495] rsyncd registering 1 service with slpd for 3600 seconds:
2015/03/10 16:46:29 [26495] service:rsync://x3400.Moness:873/restore
2015/03/10 16:46:29 [26495] Error registering service with slp -20
2015/03/10 16:46:29 [26495] Error registering service with slp 32648
2015/03/10 16:47:42 [26515] name lookup failed for 192.168.169.162: Name or service not known
2015/03/10 16:47:42 [26515] connect from UNKNOWN (192.168.169.162)
2015/03/10 16:47:42 [26515] rsync to restore/ from UNKNOWN (192.168.169.162)
2015/03/10 16:47:42 [26515] receiving file list
2015/03/10 16:47:42 [26515] rsync: chgrp “.” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: chgrp “.@__thumb” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: chgrp “.@__thumb/image_frame” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: chgrp “.@__thumb/sound” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: chgrp “.@__thumb/transcode” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: chgrp “.hccache” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: chgrp “.upload_cache” (in restore) failed: Operation not permitted (1)
2015/03/10 16:47:42 [26515] rsync: recv_generator: mkdir “Music/Ambient/.@__thumb” (in restore) failed: Permission denied (13)
2015/03/10 16:47:42 [26515] *** Skipping any contents from this failed directory ***
2015/03/10 16:47:42 [26515] rsync: recv_generator: mkdir “Music/Ambient/Gary P Lock/.@__thumb” (in restore) failed: Permission denied (13)
2015/03/10 16:47:42 [26515] *** Skipping any contents from this failed directory ***
2015/03/10 16:47:42 [26515] rsync: recv_generator: mkdir “Music/Ambient/Gary P Lock/Corryhabbie/.@__thumb” (in restore) failed: Permission denied (13)
2015/03/10 16:47:42 [26515] *** Skipping any contents from this failed directory ***
2015/03/10 16:47:42 [26515] rsync: recv_generator: mkdir “Music/Ballad/.@__thumb” (in restore) failed: Permission denied (13)
2015/03/10 16:47:42 [26515] *** Skipping any contents from this failed directory ***
2015/03/10 16:47:42 [26515] rsync: recv_generator: mkdir “Music/Ballad/Marianne Faithfull/.@__thumb” (in restore) failed: Permission denied (13)

It is possible (and I shall now check) the ownership and permissions of the hidden directories are different from the wanted data but I am also getting wanted the new data directories failing.