The first thing you need to do after logging in with an SSH client such as PuTTY or WinSCP is enable the rsync daemon. Edit /etc/default/rsync and make it look like the code below. All you really need to do is remove the # in front of the RSYNC_ENABLE=true line.
start rsync in daemon mode from init.d script? # only allowed values are "true", "false", and "inetd" # Use "inetd" if you want to start the rsyncd from inetd, # all this does is prevent the init.d script from printing a message # about not starting rsyncd (you still need to modify inetd's config yourself). RSYNC_ENABLE=true # which file should be used as the configuration file for rsync. # This file is used instead of the default /etc/rsyncd.conf # Warning: This option has no effect if the daemon is accessed # using a remote shell. When using a different file for # rsync you might want to symlink /etc/rsyncd.conf to # that file. # RSYNC_CONFIG_FILE= # what extra options to give rsync --daemon? # that excludes the --daemon; that's always done in the init.d script # Possibilities are: # --address=18.104.22.168 (bind to a specific IP address) # --port=8730 (bind to specified port; default 873) RSYNC_OPTS='' # run rsyncd at a nice level? # the rsync daemon can impact performance due to much I/O and CPU usage, # so you may want to run it at a nicer priority than the default priority. # Allowed values are 0 - 19 inclusive; 10 is a reasonable value. RSYNC_NICE='' # Don't forget to create an appropriate config file, # else the daemon will not start.
We are using the default location of the rsyncd.conf file, which is in /etc. So navigate there and create the file as shown below.
pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsync.log [rsync] path = /shares/rsync uid = root gid = share read only = no list = yes auth users = root secrets file = /etc/rsyncd.secrets
The first three lines are not essential. But I would recommend at least defining the log file, since it’s handy to have while you are trying to figure out why you can’t connect to your rsync target!
The essential part starts at the [rsync] line. This configuration defines the rsync module named rsync, which is a share you need to create in the My Book Live root share directory as shown below. I created the share via the My Book Live admin and gave it Public access, as are all my other shares. If you want to name your rsync directory differently, just change the [rsync] name in brackets and set the path variable accordingly.
I got the uid and gid settings by navigating to the* /shares* directory and doing a listing as shown below. The uid (user id) is listed first, followed by the gid (group id).
My BookLive:/shares# ls -al total 388 drwxr-xr-x 7 root share 65536 Aug 1 09:52 . drwxr-xr-x 25 root root 4096 Jul 31 15:36 .. drwxr-xr-- 2 root root 65536 Aug 1 09:55 .mediacrawler drwxrwxr-x 5 root share 65536 Jul 7 16:19 Public drwxrwxr-x 30 root share 65536 Jul 31 15:11 nasrev_backup drwxrwxr-x 4 root share 65536 Jul 8 11:09 opti990_backup drwxrwxrwx 6 root share 65536 Mar 23 15:17 rsync
The rsync apps in the Synology and QNAP both require username and password to be entered, so I setroot as the user (auth users = root in rsyncd.conf). The password needs to be entered in thersyncd.secrets file, which is also located in /etc. I entered:
This is in the form username:password. Note that because the password is in cleartext, I had to limit access to only the file owner, which I did by entering the line below while in the* /etc* directory:
chmod 600 rsyncd.secrets
At this point, everything we need has been defined, so we need to start rsync with this command: