× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Volume backup via rsync: exclusions format

dmuller
Follower

Volume backup via rsync: exclusions format

Firmware 6.5.0.

 

There are several existing threads on setting up backups using the rsync protocol, and a little bit of discussion about how to specify exclusions. Since I just got my first ReadyNAS have spent the afternoon figuring out how to configure a backup the way I wanted it, I wanted to share what I figured out. You can figure most of this out from a careful study of rsync, but it's a little difficult when you don't know the exact form of the rsync command line that results from input to the graphical configuration.

 

My specific use case was a desire to do a backup of the only (default) volume to a USB drive, while omitting snapshots and some specific shares.

 

System prep:

  1. Plug the drive in. Find it in System->Overview, click the gear next to it, and format it. (Warning: This deletes all data on the drive.) 
    Select the file system you want to use. I used ext4, assuming that a native Linux OS would be faster. I assume this would work with a Windows-compatible file system, also, which would make it easier to access the backup from a Windows system. Mine was a used drive with old data on it that I didn't care about. 
  2. Make sure that rsync is turned on in System->Settings.
  3. In Shares, find the drive, which will be somewhere under the server's "media" folder. Mine was named USB_HDD_1. Make a note of this for later. Choose Settings from its context menu. Under Network Access->RSYNC, turn this protocol on, make sure that the default access is read/write, and disable password protection. If you care about security, you can add "localhost" to the list of hosts allowed to access. (I assume this makes it inaccessible via rsync to other systems on the network, but have not yet verified this.) You may also turn off other protocols.

Create a backup with these characteristics:

 

Source:

  Type: Local

  Location: /data   (Use whatever the name of your volume is; the default volume for a new system is "data".)

 

Destination:

  Type: Remote

  Host: localhost

  Protocol: remote: Rsync Server (Obviously it's not really remote. SSH is unnecessary since data is not leaving the server.)

  Share: USB_HDD_1 (Use whatever you found as the name of the drive.)

  (Leave other fields empty.)

 

After creating the backup, edit its settings.

For the Source you should see Type as "volume" and Name as "volume: data" (or whatever your volume name is). Everything else is blank.

Under Destination, you should see Type as "remote", Name as "remote: RSync Server", Host as "localhost", and Path as something like "USB_HDD_1" based on what you picked earlier.

Under Advanced, disable compression (there's probably no point to it since the data is not leaving the server). You can now add exclusions here.

 

The exclusions are matched against file path names during the backup. They use forward-slashes as directory separators, Unix-style, of course. If a directory is excluded, everything under it is also excluded. (Rsync is more flexible than that, but such power is not accesible through the Web interface.)

 

Here are some basic rules on how to write them:

  • An asterisk matches any sequence of characters, except directory separators (forward slashes). For example, an exclusion like "*.jpg "causes all files ending in ".jpg" to be excluded, wherever they are in the tree.
  • Two asterisks match any sequence of characters, including directory separators.
  • An exclusion that ends with a slash matches only directories, not files. So an exclusion "snapshot/" will skip any directory that is named "snapshot", no matter where it appears in the tree. (That would be a way to exclude visible snapshots, if you have shares on which you made snapshots accessible.)
  • An exclusion that starts with a slash has to match from the beginning of a path name. The path names against which the patterns are matched start with the volume name. So in my case, to exclude a share, I use for example "/data/Pictures/".  If you were backing up a particular share or directory, you would start the exclusion with the directory's name (not its whole path), for example "/Pictures/2011/Awful/" if your backup source was the Pictures share, or "/2011/Awful/" if your source was the 2011 directory on the Pictures share.

 

For a volume backup of volume "data", you may want to define these exclusions:

  • /data/._share/  (Excludes snapshots.)
  • /data/*/snapshot/ (Excludes snapshots on volumes configured to make them accessible to users.)
  • /data/.timemachine/ (I don't have any Apple computers, but I assume this is where Time Machine stores their backups. You may or may not want this.)
  • /data/.vault/ (I haven't used ReadyVault; I assume it stores something here.)
  • /data/.apps/ (Maybe apps store data here? Anyone know?)

 

Anyway, I hope someone else finds this useful! None of the existing discussions that I found discussed how to "root" ReadyNAS's rsync backup exclusions, which was a key piece of missing information for me.

 

Model: RN204|ReadyNAS204
Message 1 of 2
StephenB
Guru

Re: Volume backup via rsync: exclusions format


@dmuller wrote:
  • /data/.apps/ (Maybe apps store data here? Anyone know?)

This is where the apps are installed (/apps is a mount point for this folder).

Message 2 of 2
Top Contributors
Discussion stats
  • 1 reply
  • 3216 views
  • 0 kudos
  • 2 in conversation
Announcements