{"id":1914,"date":"2022-08-10T01:42:05","date_gmt":"2022-08-09T23:42:05","guid":{"rendered":"https:\/\/blog.zitnik.si\/?p=1914"},"modified":"2022-08-10T01:44:01","modified_gmt":"2022-08-09T23:44:01","slug":"synology-rsync-backup-to-a-linux-server","status":"publish","type":"post","link":"https:\/\/blog.zitnik.si\/?p=1914","title":{"rendered":"Synology RSYNC backup to a Linux server"},"content":{"rendered":"\n<p>Last year I bought a Synology DS1520+. I am very satisfied with it (will have a separate post on that in the near future), having more than 40TB drives in it. As all my data is there, I wanted to have a remote backup on a Linux machine via <em>rsync<\/em>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956-1024x1024.jpg\" alt=\"\" class=\"wp-image-1915\" width=\"512\" height=\"512\" srcset=\"https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956-1024x1024.jpg 1024w, https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956-300x300.jpg 300w, https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956-150x150.jpg 150w, https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956-768x768.jpg 768w, https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956-64x64.jpg 64w, https:\/\/blog.zitnik.si\/wp-content\/uploads\/2022\/08\/PE840_Front__32517.1599147444.1280.1280__93956.jpg 1200w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><figcaption>Dell PowerEdge R840<\/figcaption><\/figure>\n<\/div>\n\n\n<p>At the faculty (where I work), server room of our lab was being cleaned and two old machines were meant to be dumped away. One very old server and a bit newer Dell PowerEdge R840. The latter featured Intel Xeon, 8GBs of RAM and two SAS controllers. One of the SAS controller was attached to 4 HDD slots and there were additional 4 SATA controllers on a motherboard. The only downside was the loudness of the machine but that would not be a problem as the server would be powered on only when backing up. <\/p>\n\n\n\n<p>The older server (an 2001 year IBM machine) also featured a SAS rack for 4 SATA drives. <\/p>\n\n\n\n<p>I took some time, installed another SAS rack into the server and connected additional two SATA drives directly to motherboard. Of course I needed to solder some power cables to existing power supply. As I used old drives, the total installation of 10 HDD drives got me around 5.5 TBs of space (enough for my current backup needs). I also manages to fix all the internals in the server and closed the chassis. <\/p>\n\n\n\n<p>I installed an Ubuntu server, setup LVM (so that all the drives represented one logical drive), and setup basic rsync server.<\/p>\n\n\n\n<p><strong>Backing up from a Synology<\/strong><\/p>\n\n\n\n<p>My first backup was done in local network and it needed quite some time for cca. 4 TB of data. Then I moved the machine to a remote location. Of course the idea was to set up rsync via SSH. Everything was great until I turned SSH on.<\/p>\n\n\n\n<p>I could not find the problem in configuration to enable rsync via SSH. I read many forums, posts related to the problem (mostly people were using Synology as a target and not the way I used it), &#8230; I managed to find out that rsync configuration must be user-specific, but the usage of full path inspired me by <a rel=\"noreferrer noopener\" href=\"https:\/\/warmestrobot.com\/blog\/2021\/10\/28\/synology-hyper-backup-to-rsync-compatible-server\" target=\"_blank\">warmestrobot&#8217;s blog<\/a>. The solved problems were the following:<\/p>\n\n\n\n<p><strong>Rsync configuration<\/strong> (problem 1)<\/p>\n\n\n\n<p>I configured fstab file to automatically mount shared volume I was planning to use for backup. Then I configured a general rsnycd.conf file. <em>And here was the problem!<\/em><\/p>\n\n\n\n<p>When Synology connects to you rsnyc-enabled server via SSH, it launches a new rsync daemon as the SSH logged-in user. Therefore rsync daemon does not need to be running and <strong><em>rsyncd.conf must be in the home folder of the SSH user<\/em><\/strong>.<\/p>\n\n\n\n<p><strong>Synology DSM UI settings<\/strong> (problem 2)<\/p>\n\n\n\n<p>In the Synology Hyper Backup app you define the specifics of a backup task, such as what to backup, how often, destination path, credentials, &#8230; When enabling <em>transfer encryption<\/em> (i.e., SSH), the path in the Module <strong><em>must be absolute path at the target machine<\/em><\/strong> (e.g., in my case was <em>\/home\/slavkoz\/backups<\/em>, where my backup volume was mounted).<\/p>\n\n\n\n<p>Finally, after successful setup, timed powering on and turning of the machine, everything was working.<\/p>\n\n\n\n<p>Still, currently I do not use that server as backup tasks are (a) too slow, (b) server is too loud to be running two days in a row per week, and (c) it uses a lot of power. Therefore I will buy another Synology just for the remote location.<\/p>\n<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div>","protected":false},"excerpt":{"rendered":"<p>Last year I bought a Synology DS1520+. I am very satisfied with it (will have a separate post on that in the near future), having more than 40TB drives in it. As all my data is there, I wanted to have a remote backup on a Linux machine via rsync.&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/blog.zitnik.si\/?p=1914\">Continue reading<span class=\"screen-reader-text\">Synology RSYNC backup to a Linux server<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":1916,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,30],"tags":[47,44,46],"class_list":["post-1914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-engineering","category-free-time","tag-backup","tag-hobby-projects","tag-synology","entry"],"_links":{"self":[{"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/posts\/1914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1914"}],"version-history":[{"count":2,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/posts\/1914\/revisions"}],"predecessor-version":[{"id":1918,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/posts\/1914\/revisions\/1918"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=\/wp\/v2\/media\/1916"}],"wp:attachment":[{"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zitnik.si\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}