Backup a Linux PC to a Synology NAS using Rsync

Rsync is a Linux tool that can be used to sync files from one location to another. After the initial Rsync job finishes, your future backups will be incremental (as opposed to full). For this reason, the initial backup will take significantly longer than subsequent backups.

 


 1 - Login to DSM, open the “Control Panel”, go to “File Services” and ensure that “enable rsync service” is checked.

 


 2- Create a “Backups” folder and note the volume number (you will need this later) .


3- Ensure that the user account that you will be authenticating with has read/write access.

4- Create a subfolder in the “Backups” folder with the name of the PC that you will be backing up.

 


5- If your firewall is enabled, create a firewall rule that opens port 22. NOTE: you can secure this one step further if you’d like by only opening port 22 traffic to internal IP addresses (use your internal IP address range). This rule must be above any “deny” rules that exist.

 

6- Login to your Linux PC and open Terminal. At this point, we will begin to construct our Rsync command. Many different parameters can be added to an Rsync command, but in this tutorial, we will back up our entire Linux hard drive to our “Backups” PC subfolder on our Synology NAS. The Rsync command will be constructed as follows:



Enter the password of your NAS user. NOTE: you might need to enter the password of your Linux user first.

When the dry run has finished (assuming the results are what you were expecting), remove the “n” parameter, and run the command. When prompted, enter the NAS password once again.

When the process is completed, you will see that your files are now on your Synology NAS in the folder we created.


 


Conclusion

The initial time executing this, all documents should be supported which will take somewhat longer than resulting reinforcements. Rsync does gradual reinforcements, and that implies that it will see the documents that are changed and back them up to the Synology NAS. This interaction isn't robotized! You may have the option to back up your machines when you execute the order. In the event that you might want to robotize this cycle by utilizing SSH keys and Cron, kindly look at our instructional exercise!

It's consistently smart to reinforcement your Synology NAS offsite. Assuming you're keen on doing that, look at our instructional exercises on the best way to reinforcement your Synology NAS to a Raspberry Pi or Backblaze B2!

Post a Comment

Previous Post Next Post