Troubleshooting rsync with Readynas, Azure and Centos

2018, Jan 09    

Years ago i bought a couple of Netgear Readynas devices.  A duo, and then subsequently a duo v2.  They’re pretty basic, but offered good squeezebox support and a cheap way of me storing TB of data in a RAID config.

Both of the Readynas devices support backup operations to send their data on a scheduled basis.  I’d normally opt for the simplicity of CIFS/Samba, but my internet provider has decided to block those ports and the Readynas devices don’t allow you to use a non-standard port.  Thusly the only other way to get the job done is to use rsync.

My desired location for the data backup is in Azure (naturally!).  Ideally in Azure files as my data will be the most accessible to me over an smb share in the same way that i’ve always accessed my ReadyNas devices.

Here’s a run down of a bunch of the errors i received when doing this and how to get around them.

rsync: getaddrinfo: myserver.northeurope.cloudapp.azure.com 873: Name or service not known

It turned out that my rsync daemon wasn’t listening correctly.

Check with

netstat -l | grep rsync

The quick command to get it running is

rsync --daemon

rsync: failed to set times on “.” (in frontbut): Operation not permitted (1)

sending incremental file list
./
rsync: failed to set times on "." (in frontbut): Operation not permitted (1)

At first i thought this problem was because of the way i was mounting Azure files and that it’s filesystem didn’t support it. Most of the solutions on the web tell you to use the -O flag to omit updating directory times.

However the solution was that the username my Readynas was using was not the owner of the directory.

This statement changes the ownership (recursively) of the directory to user1. This should match the username you are using in the Readynas and the rsyncd.conf file

chown -R user1 /datadisk/mynasfiles

ERROR: The remote path must start with a module name not a /

Pretty easy one here. The path must only represent the module defined in the rsyncd.conf file – not the directory path.
Rnas backup destination

@ERROR: Unknown module ‘mnt’

I was having an issue whereby the config file i was using wasn’t being picked up by rsync (typo).
I was editing /etc/rsync.conf when it should have been /etc/rsyncd.conf.
Inside this configuration files are various module definitions (specifying the path etc), the module must be used.
rsync module

@ERROR: chroot failed

In your rsyncd.conf file make sure that chroot = false

use chroot = false

@ERROR: chdir failed

Ensure that the directory has the correct permissions allocated.

chmod 664 rntwo

My final Rsyncd.conf file

# /etc/rsyncd: configuration file for rsync daemon mode
# -----------------------------------------------------

 use chroot = false
 max connections = 4
# pid file = /var/run/rsyncd.pid
 exclude = lost+found/ $RECYCLE.BIN/
 transfer logging = yes
 timeout = 900
 ignore nonreadable = yes
 dont compress   = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2

uid = ruser
gid = ruser
#address = LOCAL_MGT_NETWORK_IP
strict modes = false
read only = false
#write only = no
#list = yes
incoming chmod  = 0644
outgoing chmod  = 0644

[rntwo]
        path = /mnt/rntwo

[frontbut]
        path = /datadrive/rntwo/frontbut

[media]
        path = /datadrive/rntwo/media

[bkp]
        path = /datadrive/rntwo/bkp

[rnone]
        path = /mnt/rnone

# sample module
# [ftp]
#        path = /home/ftp
#        comment = ftp export area