Creating Rsync Tasks
4 minute read.
Last Modified 2022-05-19 10:42 EDTUsers often have to copy data to another system for backup or migrating to a new system. A fast and secure way of doing this is by using rsync. These instructions assume that you are using TrueNAS systems for both sides of the rsync task: Host and Remote.
Rysnc requires a dataset with the needed data on the Host or Remote system. Rsync provides the ability to either Push or Pull data. When using rsync to Push, data copies from a Host system to a Remote system. When using rsync to Pull, data is pulled from a Remote system and put on the Host system.
The Remote system must have the rsync service activated. TrueNAS has additional requirements depending on if you choose the Module or SSH rsync mode.
Before you create an rsync task on the Host system, you must create a module on the Remote system. When TrueNAS is the Remote system, create a module by going to Services and clicking edit for the rsync service. Click the Rsync Module tab, then click ADD.
Log in to the Host system interface, go to Tasks > Rsync Tasks, and click ADD.
Select the source dataset to use with the rsync task and a user account to run the rsync task. Choose a direction for the rsync task.
Select a schedule for the rsync task.
Next, enter the Remote Host IP address or hostname. Use the format username@remote_host when the user name differs on the Remote host. Select Module in the Rsync Mode dropdown. Enter the Remote Module Name as it appears on the Remote system.
Configure the remaining options according to your specific needs.
Unsetting Enabled disables the task schedule. You can still save the rsync task and run it manually.
The Remote system must have SSH enabled. To enable SSH in TrueNAS, go to Services and toggle SSH.
The Host system needs an established SSH connection to the Remote for the rsync task. To create the connection, go to System > SSH Connections and click ADD. Configure a Semi-automatic connection and set Private Key to Generate New.
Go to Tasks > Rsync Tasks and click ADD.
Configure the SSH settings first by selecting SSH in the Rsync Mode dropdown and entering the Port number and Remote Path.
Next, define the Source dataset for the rsync task and select an account in User. The name in User must be identical to the SSH Connection Username.
Choose a direction for the rsync task, either Push or Pull, and define the task Schedule.
Next, enter the Remote host IP address or host name. Use the format username@remote_host if the user name differs on the Remote host. Configure the remaining options according to your specific needs.
Unsetting Enabled disables the task schedule without deleting the configuration. You can still run the rsync task by going to Tasks > Rsync Tasks and clicking , then RUN NOW.
The rsync task does not work when the related system service is off. To turn the rsync service on, go to Services and toggle rsync. See ConfiguringRsync for more information on rsync configuration and module creation.