How to Rsync from Remote Server to Synology

I hava a synology at home, mainly use to store important files, and realize beside have a backup of my server files on dropbox, may be it can have another copy in Synology as well. I explored the possibility of rsync the backup either on dropbox or server into synology, and… it works!

3. Try to ssh into Synology with username “root”. The root password is the same with “admin”.

If are you done, let’s do it.

Generate SSH Key

You wouldn’t want to key in password whenever want to access to the server to grab the file. Generate a “custom” ssh key which will be used for synology. Remember, please do not set the password. Give you ssh file a “special name”, DO NOT use the default. I.e we used synobackup, there are 2 files will be generate

1. synobackup – This is the private key files
2. synobackup.pub – This is the public key which will be placed on the remote server.

Next, we will copy this 2 files into Synology folder ServerBackup. We create a folder name “scripts”, and the file will be placed in synology

We will copy the key on synobackup.pub into remote server’s ssh directory “.ssh/authorized_keys” for the user’s home directory where you will login with the username later. i.e “/home/takizo/.ssh/authorized_keys”

Warning:Permanently added'[godzilla.takizo.com]:2222,[123.456.123.111]:2222'(ECDSA)tothe list of known hosts.

This will add the host into /root/.ssh/known_hosts, when the script is run next time, it will not prompt the message again.

Setup the Task on Synology

Since the script is working perfectly fine. The last step is add it into Synology’s Task Schedule.

1. Go to “Control Panel” -> “Task Schedule”
2. Create “User defined-script”
3. Give a meaningful name for your “Task”
4. User choose “root” or any user you prefer
5. User-defined script: The script you created earlier inside Synology folder, “/volume/ServerBackup/scripts/database.backup.sh”
6. Put up a schedule for this, how often it should run and at what time.

After the schedule has been created, try run it again and check is the files transfer into your Synology folder (if you don’t have new copy of file in the server, delete the files earlier being rsync into synology).

Yep, basically you have another copy of backup on synology! Enjoy backup more stuff from remote server 😉

One Response

Bob · December 22, 2017 at 09:29:08 · →

Nothing in the startup of the Synology NAS software ever told me the password for user Admin. Thus it is impossible to log in as root. I changed the password to user admin but the only way I can become root is via sudo. Your example doesn’t show you logged in as root, it shows that you created your key files in /users/takizo/.ssh/ So what is the login as root instruction for?

What user should create the key files? Does it need to be the one that owns the shared folder? Does it matter? You are very unclear about what is actually required. In the Task Schedule section you say “4. User choose “root” or any user you prefer”. Doesn’t it need to match the user the key was created for?

You say “We create a folder name “scripts”, and the file will be placed in synology” . What is “synology”. Is that a directory name, or do you actually mean the scripts directory just created on the NAS drive? Very unclear.