How to sync two FreeNAS storage using rsync

FreeNAS supports rsync and that’s one of the most interesting feature of the operating system. rsync is a protocol for file synchronization and transfer, a really useful tool in a storage device.

In this tutorial we’ll see how to sync a dataset – a sort of folder – between two different FreeNAS devices. In our lab we used two virtual machines following this scheme:

  • machine 01 is a file server with IP address 192.168.2.70
  • machine 02 is a synced storage for business continuity purposes with IP address 192.168.2.75

The first machine will push (rsync client) data while the second one will pull (rsync server) them.

The configuration procedure involves both the FreeNAS devices and it’s rather simple.

Log in machine 01 and Add a rsync module:

How to sync two FreeNAS storage using rsync

Specify the name, the dataset – folder – you want to sync and the user:

How to sync two FreeNAS storage using rsync

Then create a new rsync task:

How to sync two FreeNAS storage using rsync

Select the folder path (the same configured with the rsync module) and specify root as the user. Specify the IP address of the pull FreeNAS device as Remote Host, the name of rsync module and set the Direction on Push:

How to sync two FreeNAS storage using rsync

Log in machine 02 and Add a rsync module:

How to sync two FreeNAS storage using rsync

Specify the name, the dataset – folder – where the data will be pulled and the user:

How to sync two FreeNAS storage using rsync

Then create a new rsync task:

How to sync two FreeNAS storage using rsync

Select the folder path (the same configured with the rsync module) and specify root as the user. Specify the IP address of the puish FreeNAS device as Remote Host, the name of rsync module and set the Direction on Pull:

How to sync two FreeNAS storage using rsync

It’s time to enable the rsync service on both the devices. Now rsync will keep the two datasets synced:

How to sync two FreeNAS storage using rsync

Read related articles