Backup Synology NAS to WD Cloud EX2 Ultra using rsync

Hello!

I’m having some trouble setting up a rsync server on My Cloud Ex2 Ultra running OS5 (FW 5.26.300). The objective is to backup data from a Synology NAS to the rsync server on the WD NAS using HyperBackup. I’ve been able to set it up and make it work but as soon as I reboot the My Cloud NAS, the Rsync server settings are gone. This is what I’ve done to set it up:

  • Login through ssh (I use putty)
  • Create the file /etc/rsyncd.secrets and leave it empty.
  • Create the file /etc/rsyncd.conf with the following lines:
    • [shares]
      path = /shares
      uid = root
      gid = root
      read only = no
      list = yes
      auth users = all
      secrets file = /etc/rsyncd.secrets
      hosts allow = MY.NAS.IP/MY.SUBNET.MASK
  • Start the daemon: rsync --daemon

Then, I go into Synology HyperBackup and set up a RSYNC backup

  • Server IP: the IP address of My Cloud NAS.
  • Encryption Off
  • Default Port (873)
  • user: root
  • password: root

And, like I said, it works but as soon as I reboot, all these configurations are gone. How can I make those configurations persistent?

Thank you for the help :pray:

I haven’t but I’ll write to them. Maybe they can help :+1:I thought I would have more success in the forum.

With the help of @Martok I was able to find a solution. Bear in mind that I’m not using SSH because it slows things down considerably and I don’t need it.

So, in order to reload that config on every boot, I downloaded USB Backups from the App store and I modify its init.sh file (vi /shares/Volume_1/Nas_Prog/USBBackups/init.sh) with these lines at the bottom of the file (I’ve added some instructions that might be useful to the inexperienced usesers):

echo "Starting rsync with custom settings..."

# RSYNC.SECRETS FILE CREATION
# rsyncd.secrets contains all of the usernames and passwords that will be able to log in to the rsync daemon. These are independent of the user that exist in the system.
# Add each one per line, separating user and password by a colon.
 
cat <<EOF > /etc/rsyncd.secrets
testuser:testUserPassword
EOF

chmod 600 /etc/rsyncd.secrets



# RSYNCD.CONF FILE CREATION
cat <<EOF > /etc/rsyncd.conf

# lock file is the file that rsync uses to handle the maximum number of connections
# use any of your shared folders. Mine is /shares/BKP/
lock file = /shares/BKP/rsync/rsync.lock

# pid file is where the rsync daemon will write the process id that has been assigned to it
pid file = /shares/BKP/rsync/rsync.pid

log file = /shares/BKP/rsync/rsync.log

# secrets file defines the file that contains the usernames and passwords of the valid users for rsync
secrets file = /etc/rsyncd.secrets


[BKP]
    path = /shares/BKP/
    comment = Synology NAS Backup

    # When the rsync daemon is run as root, uid is used to specify which user owns the files that are transfer from and to.
    uid = testuser

    # When the daemon is run as root, gid allows us to set the group that own the files that are transferred.
    gid = share

    # read only determines if the clients who connect to rsync can upload files or not, the default of this parameter is true for all modules.
    read only = no

    # list allows the module to be listed when clients ask for a list of available modules, setting this to false hides the module from the listing.
    list = yes

    # auth users is a list of users allowed to access the content of this module, the users are separated by comas. The users don't need to exist in the system, they are defined by the secrets file.
    auth users = testuser
    
    # hosts allow contains the addresses allowed to connect to the system. Without this parameter all hosts are allowed to connect.
    # hosts allow = 192.168.1.0/255.255.255.0

EOF

chmod 700 /etc/rsyncd.conf

rsync --daemon

Since the file /shares/Volume_1/Nas_Prog/USBBackups/init.sh is persistent on every boot, I can guarantee that my custom config is loaded up on every boot.

PS: I’ve observed that changing parameters on your shares loads back the default rsync settings. So if you make changes, either reboot or execute the /shares/Volume_1/Nas_Prog/USBBackups/init.sh script.

---------------------- EDIT ----------------------

Btw, if anyone knows how to improve RSYNC transfer speeds, I’m all ears. I had the DSM custom ROM from Fox running for a few days on the EX2 Ultra and its RSYNC and WebDAV transfers were much faster. These are the test I run:

  1. Synology NAS running Hyper Backup → connect to WD NAS using RSYNC (DSM ROM) → transfer speed: ~40MB/s

  2. Synology NAS running Hyper Backup → connect to WD NAS using WebDAV (DSM ROM) → transfer speed: ~50MB/s

  3. Synology NAS running Hyper Backup → connect to WD NAS using RSYNC (OS 5 ROM) → transfer speed: <10MB/s

All of these tests were done without encryption.

So it’s clear that the My Cloud EX2 Ultra is capable of receiving data through RSYNC much faster but, for some unknown reason, OS 5 is capping it to 10 MB/s

Any ideas?

Nevermind. It does no longer happen. It might have been a mistake on my part.

That makes sense. Maybe it wouldn’t be a bad idea to disable the delta-transfer algorithm on the first backup and then enable it for incremental backup changes.

Thanks for sharing this tip. Sadly, I can’t test it because I already returned the NAS to its owner.

For whatever reason, the Synology NAS of my client can no longer connect to their MyCloud EX2 Ultra RSYNC server. I think it could have been after a DSM update on their Synology (they started having issues in late December 2023). I’ve also tried upgrading the MyCloud Ex2 Ultra firmware to the latest version (5.27.157) but still nothing.

The RSYNC server configuration is executing correctly and the secrets file is also being generated without issues but the Synology NAS just can’t connect.

Anyone else having this problem recently?

My Cloud OS5 uses a modified rsync binary that often results in connection problems. Try installing my Rsync Server app, which uses a standard rsync binary from the Debian repository and generates required files automatically from user input.

My Cloud OS5 Apps Matrix (Third-Party)

How do I reinstall the Rsync Server App? The only app I have installed is USB Backups.

edit: Nvm, I just saw the stuff on the provided link. Thanks! As soon as I can test it out I will report back.

I’ve tried that RSYNC third-party app and I was a bit confused at first because I was trying to use my configuration and it did not work. Later I realised that there are some configurable parameters in the app itself (via the MyCloud web interface) that allowed me to enable users and shares. It also generates passwords for every user but I can’t create custom passwords. That’s not really an issue for me but my worry is what happens when you reboot the NAS. Does it load back the same configuration (same shares and passwords) or do I have to redo it?

As I said, the configuration is generated automatically.

Changes are persistent, otherwise the app wouldn’t be very useful. Try it, and see for yourself.

I will. Thanks! :pray:

I installed your Rsync Server (3.2.3) App, but it will not save the “grant access” changes I made to the folder I want for the location for my backups to go to. When I go back to check to make sure the change has stuck, it reverts to the top shared folder in my list. I have done this multiple times.