<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Rsnapshot on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/rsnapshot/</link>
        <description>Recent content in Rsnapshot on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Thu, 16 Jul 2026 18:31:00 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/rsnapshot/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Synology file backup to Ubuntu: rsnapshot active pull and hard link snapshot tutorial</title>
        <link>https://knightli.com/en/2026/07/16/synology-to-ubuntu-rsnapshot-pull-backup-guide/</link>
        <pubDate>Thu, 16 Jul 2026 18:31:00 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/07/16/synology-to-ubuntu-rsnapshot-pull-backup-guide/</guid>
        <description>&lt;p&gt;If the goal is &amp;ldquo;simple, reliable, historical files can be opened directly&amp;rdquo;, it is very suitable for Ubuntu to actively pull the Synology shared folder, and then use &lt;code&gt;rsnapshot&lt;/code&gt; to make a local snapshot. Synology only provides read-only data, and Ubuntu is responsible for timing, logs, version rotation, and hard disk backup. After Synology accidentally deletes a file, it can also directly copy it back from the directory of yesterday, last week, or last month.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rsnapshot&lt;/code&gt; works based on &lt;code&gt;rsync&lt;/code&gt; and hard links. Each snapshot directory looks like a complete copy of the file, but unchanged files do not occupy disk space over and over again. Photos, videos, PDFs, DOCX, etc. are still ordinary files and do not rely on specialized recovery software or backup databases.&lt;/p&gt;
&lt;h2 id=&#34;recommended-architecture&#34;&gt;Recommended architecture
&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;群晖共享文件夹
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;photo / 工作文件 / 个人文件 / 其他共享文件夹
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        ↓ 只读 SMB、NFS，或 rsync/SSH
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Ubuntu：rsnapshot 定时拉取
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        ↓
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Ubuntu 备份硬盘（ext4、XFS 等）
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;daily.0 / daily.1 / weekly.0 / monthly.0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This is not a &amp;ldquo;Synology pushes files to Ubuntu&amp;rdquo; solution. Ubuntu has read-only access to Synology, and Synology does not need to save the write password of the Ubuntu backup disk. This permission isolation is usually more secure: when Synology is misused, affected by ransomware, or a package account is abused, the attack surface does not directly extend to Ubuntu&amp;rsquo;s historical snapshots. This judgment is based on permission isolation, rather than replacing offline disks, off-site copies, or recovery drills.&lt;/p&gt;
&lt;h2 id=&#34;applicable-scope-and-boundaries&#34;&gt;Applicable scope and boundaries
&lt;/h2&gt;&lt;p&gt;This method is especially suitable for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;common shared folders such as photos, videos, documents, project materials, etc.;&lt;/li&gt;
&lt;li&gt;want to retain multiple time points, but do not want to learn special recovery tools;&lt;/li&gt;
&lt;li&gt;There is already a dedicated backup hard drive on Ubuntu;&lt;/li&gt;
&lt;li&gt;I just want to select a few shared folders, not the entire machine image.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It primarily backs up the files themselves and is not equivalent to a complete restore of the DSM, suite configuration, database service status, or all system-level metadata. When full disaster recovery is required, Hyper Backup, application export, database backup, or other targeted solutions should still be retained.&lt;/p&gt;
&lt;h2 id=&#34;create-a-read-only-backup-account-on-synology-side&#34;&gt;Create a read-only backup account on Synology side
&lt;/h2&gt;&lt;p&gt;First create a dedicated account in DSM, such as &lt;code&gt;backup-reader&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Only grant read permission to the shared folder that needs to be backed up;&lt;/li&gt;
&lt;li&gt;Do not grant administrative permissions, write permissions and unnecessary application permissions;&lt;/li&gt;
&lt;li&gt;Use independent strong passwords;&lt;/li&gt;
&lt;li&gt;Only allow Ubuntu&amp;rsquo;s fixed IP to access related SMB/NFS services.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Do not directly reuse the daily administrator account. In this way, even if the credentials used for mounting on Ubuntu are leaked, the impact will be limited to directories that are authorized to be read.&lt;/p&gt;
&lt;h2 id=&#34;ubuntu-mount-synology-shared-folder&#34;&gt;Ubuntu Mount Synology shared folder
&lt;/h2&gt;&lt;p&gt;It is recommended to mount each shared folder to a fixed directory:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo mkdir -p /mnt/synology/photo
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo mkdir -p /mnt/synology/files
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo mkdir -p /mnt/synology/documents
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Both SMB and NFS are acceptable. Just choose a protocol that you have enabled in Synology and are familiar with. For ordinary home or small team networks, SMB is easier to check permissions, while NFS is closer to the Linux permission model.&lt;/p&gt;
&lt;h3 id=&#34;smbcifs-read-only-mount-example&#34;&gt;SMB/CIFS read-only mount example
&lt;/h3&gt;&lt;p&gt;First install the tool and create a credential file that only allows root to read:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt install -y cifs-utils rsync rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo install -m &lt;span class=&#34;m&#34;&gt;600&lt;/span&gt; /dev/null /root/.smb-synology-credentials
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo nano /root/.smb-synology-credentials
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Credential file content:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-ini&#34; data-lang=&#34;ini&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;username&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;backup-reader&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;password&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;替换为专用密码&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Added example in &lt;code&gt;/etc/fstab&lt;/code&gt;. Replace Synology IP and share name with actual values:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;//192.168.8.100/photo     /mnt/synology/photo      cifs  ro,credentials=/root/.smb-synology-credentials,vers=3.0,_netdev,nofail  0  0
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;//192.168.8.100/files     /mnt/synology/files      cifs  ro,credentials=/root/.smb-synology-credentials,vers=3.0,_netdev,nofail  0  0
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;//192.168.8.100/documents /mnt/synology/documents  cifs  ro,credentials=/root/.smb-synology-credentials,vers=3.0,_netdev,nofail  0  0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Test the mount and confirm that the directory is readable:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo mount -a
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;findmnt /mnt/synology/photo
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls -la /mnt/synology/photo &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; head
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;ro&lt;/code&gt; is the key option. If &lt;code&gt;mount -a&lt;/code&gt; reports that the authentication, protocol version or share does not exist, do not configure rsnapshot first; read through the single mount point first.&lt;/p&gt;
&lt;h3 id=&#34;nfs-read-only-mount-example&#34;&gt;NFS read-only mount example
&lt;/h3&gt;&lt;p&gt;If NFS has been enabled in DSM and the shared folder has allowed the Ubuntu IP to be mounted read-only, you can use:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt install -y nfs-common rsync rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo mount -t nfs -o ro 192.168.8.100:/volume1/photo /mnt/synology/photo
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The NFS export path varies depending on the Synology share name and volume. First confirm on the shared folder NFS permissions page of DSM. After confirming that it is readable, write the actual export path to &lt;code&gt;/etc/fstab&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;prepare-ubuntu-backup-hard-drive&#34;&gt;Prepare Ubuntu backup hard drive
&lt;/h2&gt;&lt;p&gt;The snapshot root directory should be located on Ubuntu&amp;rsquo;s dedicated backup disk, for example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo mkdir -p /srv/backup/rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;df -Th /srv/backup/rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;gives priority to Linux file systems such as &lt;code&gt;ext4&lt;/code&gt; and &lt;code&gt;XFS&lt;/code&gt;. &lt;code&gt;rsnapshot&lt;/code&gt; relies on hard links to save space, so do not place the snapshot root directory on file systems that do not support Unix hard links, such as FAT or exFAT; nor let the backup directory be split across different file systems.&lt;/p&gt;
&lt;p&gt;It is recommended to first confirm that the mounting of the backup hard disk is stable: after the system restarts, &lt;code&gt;/srv/backup/rsnapshot&lt;/code&gt; must still be located on the backup disk and not accidentally fall into the empty directory of the Ubuntu system disk.&lt;/p&gt;
&lt;h2 id=&#34;configure-rsnapshot&#34;&gt;configure rsnapshot
&lt;/h2&gt;&lt;p&gt;Edit &lt;code&gt;/etc/rsnapshot.conf&lt;/code&gt;. The &amp;ldquo;configuration items&amp;rdquo; and &amp;ldquo;parameters&amp;rdquo; of this configuration file are usually required to be separated by &lt;strong&gt;Tab&lt;/strong&gt;. If the verification fails after copying, first check whether they have been replaced by spaces by the editor.&lt;/p&gt;
&lt;p&gt;The following is the core configuration corresponding to the directory structure of this article:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;9
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;snapshot_root	/srv/backup/rsnapshot/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;retain	daily	7
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;retain	weekly	4
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;retain	monthly	12
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;backup	/mnt/synology/photo/	photo/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;backup	/mnt/synology/files/	files/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;backup	/mnt/synology/documents/	documents/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;has the following meaning:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Configuration&lt;/th&gt;
          &lt;th&gt;Function&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;code&gt;snapshot_root&lt;/code&gt;&lt;/td&gt;
          &lt;td&gt;Root directory where all snapshots are saved&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;code&gt;retain daily 7&lt;/code&gt;&lt;/td&gt;
          &lt;td&gt;Keep 7 daily snapshots&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;code&gt;retain weekly 4&lt;/code&gt;&lt;/td&gt;
          &lt;td&gt;Keep 4 weekly snapshots&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;code&gt;retain monthly 12&lt;/code&gt;&lt;/td&gt;
          &lt;td&gt;Keep snapshots for 12 months&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;code&gt;backup&lt;/code&gt;&lt;/td&gt;
          &lt;td&gt;Back up the read-only mount directory to the corresponding subdirectory in the snapshot&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Verify the configuration first, and then manually run a daily snapshot:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo rsnapshot configtest
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo rsnapshot daily
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After normal completion, the directory is roughly as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/srv/backup/rsnapshot/daily.0/photo/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/srv/backup/rsnapshot/daily.0/files/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/srv/backup/rsnapshot/daily.0/documents/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/srv/backup/rsnapshot/daily.1/photo/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/srv/backup/rsnapshot/weekly.0/photo/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;daily.0&lt;/code&gt; This is the latest successful snapshot. After the next run, old snapshots are rotated backwards, and versions exceeding the &lt;code&gt;retain&lt;/code&gt; number will be cleaned up.&lt;/p&gt;
&lt;h2 id=&#34;set-daily-weekly-and-monthly-scheduled-tasks&#34;&gt;Set daily, weekly, and monthly scheduled tasks
&lt;/h2&gt;&lt;p&gt;After confirming that the manual snapshot is normal, create &lt;code&gt;/etc/cron.d/rsnapshot&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo nano /etc/cron.d/rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The sample content of
is as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;0 2 * * * root /usr/bin/rsnapshot daily
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;30 2 * * 1 root /usr/bin/rsnapshot weekly
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;0 3 1 * * root /usr/bin/rsnapshot monthly
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;It is recommended to place the task in a period when Synology is relatively idle. The first backup will copy all files, which takes the most time and disk usage; subsequent runs mainly transfer the changed parts.&lt;/p&gt;
&lt;p&gt;Before running scheduled tasks, make sure the mounting is successful. You can add a simple check before rsnapshot, or implement it through systemd mounting dependency; the most important thing is not to mistake the empty directory as the source directory when &lt;code&gt;/mnt/synology/*&lt;/code&gt; is not mounted, resulting in a &amp;ldquo;successful but empty content&amp;rdquo; snapshot.&lt;/p&gt;
&lt;h2 id=&#34;how-to-confirm-that-hard-links-really-save-space&#34;&gt;How to confirm that hard links really save space
&lt;/h2&gt;&lt;p&gt;Don&amp;rsquo;t just look at the logical size displayed for each directory. You can check the inode and link count for the same unchanged file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls -li /srv/backup/rsnapshot/daily.0/photo/某个文件.jpg
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls -li /srv/backup/rsnapshot/daily.1/photo/某个文件.jpg
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If the file has not changed, you will usually see the same inode and the link count is greater than 1. To check the actual usage of the backup disk, use:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;du -sh /srv/backup/rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;df -h /srv/backup/rsnapshot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;method-to-restore-files&#34;&gt;Method to restore files
&lt;/h2&gt;&lt;p&gt;The rsnapshot command is not required for recovery. Locate the appropriate date directory and copy the target file directly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cp -a /srv/backup/rsnapshot/daily.1/photo/2026/旅行.jpg /tmp/恢复文件/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Before restoring to Synology, it is recommended to copy to a temporary directory or change the file name to confirm the content to avoid overwriting the new version that is still in use. To restore the entire folder, you should also confirm the target space and coverage first.&lt;/p&gt;
&lt;h2 id=&#34;faq&#34;&gt;FAQ
&lt;/h2&gt;&lt;h3 id=&#34;rsnapshot-is-displayed-successfully-but-the-snapshot-directory-is-empty&#34;&gt;rsnapshot is displayed successfully, but the snapshot directory is empty
&lt;/h3&gt;&lt;p&gt;First check whether the source mount point is really mounted:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;findmnt /mnt/synology/photo
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mountpoint -q /mnt/synology/photo &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; mounted
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The mere existence of the &lt;code&gt;/mnt/synology/photo&lt;/code&gt; directory does not mean that the network share is mounted. The scheduled task should be stopped, delete this invalid snapshot, repair SMB/NFS connectivity first, and then run again.&lt;/p&gt;
&lt;h3 id=&#34;configuration-check-prompts-syntax-error&#34;&gt;Configuration check prompts syntax error
&lt;/h3&gt;&lt;p&gt;Run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo rsnapshot configtest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Key check &lt;code&gt;snapshot_root&lt;/code&gt; Whether it ends with &lt;code&gt;/&lt;/code&gt;, whether the &lt;code&gt;backup&lt;/code&gt; rule has a source path and target subdirectory, and whether Tabs are used between configuration items. Don&amp;rsquo;t join cron directly without passing &lt;code&gt;configtest&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;the-snapshot-usage-is-suddenly-very-large&#34;&gt;The snapshot usage is suddenly very large
&lt;/h3&gt;&lt;p&gt;First check whether a large number of files have been renamed, moved, recoded or modified with time/permissions causing rsync to re-copy. Hard links can only reuse historical files whose content and attributes have not changed; when backing up for the first time, organizing photo libraries in batches, or applying export directories with frequent changes, it is normal for the usage to increase.&lt;/p&gt;
&lt;h3 id=&#34;is-it-possible-to-directly-back-up-the-entire-synology&#34;&gt;Is it possible to directly back up the entire Synology
&lt;/h3&gt;&lt;p&gt;It is technically possible to mount more shared folders, but it is not recommended to add the system directory, package internal directory and all volumes indiscriminately. Prioritize starting with user data such as photos, documents, and work files, and then gradually expand after confirming the recovery process; database and application configurations should be processed separately according to their respective export or backup mechanisms.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;The process of Ubuntu actively pulling + rsnapshot is very clear: Synology provides a read-only share, Ubuntu mounts it to &lt;code&gt;/mnt/synology/&lt;/code&gt;, and rsnapshot is written to the dedicated backup disk. &lt;code&gt;daily&lt;/code&gt;, &lt;code&gt;weekly&lt;/code&gt;, &lt;code&gt;monthly&lt;/code&gt; snapshots. Historical versions are ordinary files that can be browsed directly, and recovery means copying the files; at the same time, Synology does not need to have write permissions on the Ubuntu backup disk. This is a practical solution for long-term storage of photos, documents and work files.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
