{"id":630,"date":"2021-02-26T22:36:58","date_gmt":"2021-02-26T22:36:58","guid":{"rendered":"http:\/\/mastercom.es\/?p=630"},"modified":"2023-08-21T19:39:19","modified_gmt":"2023-08-21T19:39:19","slug":"630-2","status":"publish","type":"post","link":"http:\/\/mastercom.es\/en\/630-2\/","title":{"rendered":"Configuring an rsync Task"},"content":{"rendered":"<p>[et_pb_section fb_built=\u00bb1&#8243; _builder_version=\u00bb4.16&#8243; _module_preset=\u00bbdefault\u00bb global_colors_info=\u00bb{}\u00bb theme_builder_area=\u00bbpost_content\u00bb][et_pb_row _builder_version=\u00bb4.16&#8243; _module_preset=\u00bbdefault\u00bb global_colors_info=\u00bb{}\u00bb theme_builder_area=\u00bbpost_content\u00bb][et_pb_column type=\u00bb4_4&#8243; _builder_version=\u00bb4.16&#8243; _module_preset=\u00bbdefault\u00bb global_colors_info=\u00bb{}\u00bb theme_builder_area=\u00bbpost_content\u00bb][et_pb_text _builder_version=\u00bb4.16&#8243; _module_preset=\u00bbdefault\u00bb custom_padding=\u00bb22px|||||\u00bb global_colors_info=\u00bb{}\u00bb theme_builder_area=\u00bbpost_content\u00bb]<\/p>\n<h1>Configuring an rsync Task<\/h1>\n<div class=\"lead\">How to configure automated data transfers using rysnc.<\/div>\n<p class=\"reading-time\"><i class=\"fa fa-clock\" aria-hidden=\"true\"><\/i>\u00a0 9 minute read<\/p>\n<p>Data often needs to be copied to another system for backup or when migrating to a new system. A fast and secure way of doing this is by using rsync.<\/p>\n<p>Rsync provides the ability to either<span>\u00a0<\/span><em>push<\/em><span>\u00a0<\/span>or<span>\u00a0<\/span><em>pull<\/em><span>\u00a0<\/span>data. When using rsync to<span>\u00a0<\/span><em>push<\/em>, data is copied from a<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system to a<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. When using rsync to<span>\u00a0<\/span><em>pull<\/em>, data is pulled from a<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system and put on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system. To do this, a dataset with data available for transfer must exist on either the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>or the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. See<span>\u00a0<\/span><a href=\"https:\/\/www.truenas.com\/docs\/hub\/initial-setup\/storage\/datasets\/\">ZFS Datasets<\/a><span>\u00a0<\/span>for more details about creating a dataset.<\/p>\n<h2 id=\"rsync-service\">Rsync Service<a aria-hidden=\"true\" href=\"https:\/\/www.truenas.com\/docs\/hub\/tasks\/scheduled\/rsync\/#rsync-service\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" fill=\"currentColor\" width=\"24\" height=\"24\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"><\/path><path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"><\/path><\/svg><\/a><\/h2>\n<p>The rsync task does not work if the related system service is not turned on. To turn the rsync service on, go to<span>\u00a0<\/span><strong>Services<\/strong><span>\u00a0<\/span>and click the slider for<span>\u00a0<\/span><em>rsync<\/em>. To activate the service whenever TrueNAS boots, set<span>\u00a0<\/span><em>Start Automatically<\/em>.<\/p>\n<p>The rsync service settings can be configured by clicking<span>\u00a0<\/span><i class=\"fas fa-pen\" aria-hidden=\"true\" title=\"pencil\"><\/i>. The default TCP port that rsync listens on can be changed, and additional auxiliary parameters from<span>\u00a0<\/span><a href=\"https:\/\/www.samba.org\/ftp\/rsync\/rsyncd.conf.html\">rsyncd.conf<\/a><span>\u00a0<\/span>can be added.<\/p>\n<p>Unless a specific setting is needed, it is recommended to use the default settings for the rsync service. Don\u2019t forget to click<span>\u00a0<\/span><em>SAVE<\/em><span>\u00a0<\/span>after changing any settings.<\/p>\n<h2 id=\"create-rsync-task\">Create Rsync Task<a aria-hidden=\"true\" href=\"https:\/\/www.truenas.com\/docs\/hub\/tasks\/scheduled\/rsync\/#create-rsync-task\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" fill=\"currentColor\" width=\"24\" height=\"24\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"><\/path><path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"><\/path><\/svg><\/a><\/h2>\n<p>To create an rsync task, go to<span>\u00a0<\/span><strong>Tasks &gt; Rsync Tasks<\/strong><span>\u00a0<\/span>and click<span>\u00a0<\/span><em>ADD<\/em>. There are two primary rsync modes:<span>\u00a0<\/span><em>Module<\/em><span>\u00a0<\/span>and<span>\u00a0<\/span><em>SSH<\/em>. The requirements for each mode are different. Refer to the appropriate section below for your desired rsync mode.<\/p>\n<h3 id=\"rsync-mode-module\">Rsync Mode: Module<a aria-hidden=\"true\" href=\"https:\/\/www.truenas.com\/docs\/hub\/tasks\/scheduled\/rsync\/#rsync-mode-module\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" fill=\"currentColor\" width=\"24\" height=\"24\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"><\/path><path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"><\/path><\/svg><\/a><\/h3>\n<p>First, turn on the rsync service on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. Before creating an rsync task on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system, a module on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system must be created. Create a module by going to<span>\u00a0<\/span><strong>Services<\/strong><span>\u00a0<\/span>and clicking<span>\u00a0<\/span><i class=\"fas fa-pen\" aria-hidden=\"true\" title=\"Pen\"><\/i>\u00a0 for the rsync service. Then go to<span>\u00a0<\/span><strong>Rsync Module &gt; ADD<\/strong>.<\/p>\n<p>Enter a descriptive name for the rsync module and use the file browser to define the path to the dataset to be transferred from the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system.<\/p>\n<p>Select the permissions for the module by selecting an option from the<span>\u00a0<\/span><em>Access Mode<\/em><span>\u00a0<\/span>dropdown.<\/p>\n<p>Set the<span>\u00a0<\/span><em>Max Connections<\/em>. Entering<span>\u00a0<\/span><em>0<\/em><span>\u00a0<\/span>sets the amount of connections to unlimited.<\/p>\n<p>When using a specific user or group during data transfers to and from the module, select them from the related dropdowns.<\/p>\n<p>You can also define a list of hosts that are allowed or denied access to the rsync module.<\/p>\n<div class=\"pageinfo pageinfo-primary\">\n<p>If a<span>\u00a0<\/span><em>Hosts Allow<\/em><span>\u00a0<\/span>list is specified,<span>\u00a0<\/span><strong>only<\/strong><span>\u00a0<\/span>the IPs and hostnames on the list will be able to connect to the module.<\/p>\n<\/div>\n<p>Other options include specifying a comment for the rsync module and any additional parameters from<span>\u00a0<\/span><a href=\"https:\/\/www.samba.org\/ftp\/rsync\/rsyncd.conf.html\">rsyncd.conf<\/a>.<\/p>\n<p>When a module has been created on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system, log in to the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system interface, go to<span>\u00a0<\/span><strong>Tasks &gt; Rsync Tasks<\/strong>, and click<span>\u00a0<\/span><em>ADD<\/em>.<\/p>\n<p>Select the source dataset to be used for the rsync task. This dataset will be transferred to the remote module when<span>\u00a0<\/span><em>pushing<\/em>. Alternately, this dataset will be used as the destination when<span>\u00a0<\/span><em>pulling<\/em><span>\u00a0<\/span>data from the module.<\/p>\n<p>Select a user to run the rsync task. The user selected must have write permissions to the specified directory chosen for the module on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system.<\/p>\n<p>Choose a direction for the rsync task. When<span>\u00a0<\/span><em>push<\/em><span>\u00a0<\/span>is selected, data from the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset copies to the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>module. When<span>\u00a0<\/span><em>pull<\/em><span>\u00a0<\/span>is selected, data from the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>module is copied into the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset.<\/p>\n<p>Select a schedule for the rsync task to run on. If a custom schedule is desired, select<span>\u00a0<\/span><em>Custom<\/em><span>\u00a0<\/span>and fill out the custom scheduler to meet your needs. The custom scheduler can accept standard<span>\u00a0<\/span><a href=\"https:\/\/www.freebsd.org\/cgi\/man.cgi?query=crontab&amp;sektion=5\">cron input strings<\/a><span>\u00a0<\/span>for the<span>\u00a0<\/span><em>Minutes<\/em>,<span>\u00a0<\/span><em>Hours<\/em>, and<span>\u00a0<\/span><em>Days<\/em>.<\/p>\n<p>By default, the rsync task will include all subdirectories of the chosen<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset with the transer. To disable this, unset the<span>\u00a0<\/span><em>Recursive<\/em><span>\u00a0<\/span>option.<\/p>\n<p>Next, enter the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>host IP address or hostname. Use the format<span>\u00a0<\/span><em>username@remote_host<\/em><span>\u00a0<\/span>if the username differs on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>host. Select<span>\u00a0<\/span><em>Module<\/em><span>\u00a0<\/span>in the<span>\u00a0<\/span><em>Rsync Mode<\/em><span>\u00a0<\/span>dropdown. Enter the<span>\u00a0<\/span><em>Remote Module Name<\/em><span>\u00a0<\/span>exactly.<\/p>\n<p>Setting the<span>\u00a0<\/span><em>Times<\/em><span>\u00a0<\/span>option preserves the modification times of files. Set<span>\u00a0<\/span><em>Compress<\/em><span>\u00a0<\/span>to reduce the size of data to transmit. This is recommended for slow connections.<\/p>\n<p><em>Archives<\/em><span>\u00a0<\/span>can be set to run recursively, preserving symlinks, permissions, modification times, group, and special files. When run as root, the owner, device files, and special files are also preserved. This is equivalent to passing the flags<span>\u00a0<\/span><code>-rlptgoD<\/code><span>\u00a0<\/span>to rsync.<\/p>\n<p>When<span>\u00a0<\/span><em>Delete<\/em><span>\u00a0<\/span>is set, the rsync task will delete files in the destination directory that do not exist in the source directory. For example, if the task is set to<span>\u00a0<\/span><em>pull<\/em>, this option will delete any files on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset that do not existing on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>module. Alternatively, if the task is set to<span>\u00a0<\/span><em>push<\/em>, this option will delete any files on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>module that are not in the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset. This is a<span>\u00a0<\/span><strong>destructive<\/strong><span>\u00a0<\/span>option. Use with caution as data can be deleted permanently.<\/p>\n<p>Set the<span>\u00a0<\/span><em>Quiet<\/em><span>\u00a0<\/span>option to suppress informational messages from the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. Set the option<span>\u00a0<\/span><em>Preserve Permissions<\/em><span>\u00a0<\/span>to preserve original file permissions. This is useful when the user is set to root.<\/p>\n<p>Set<span>\u00a0<\/span><em>Preserve Extended Attributes<\/em><span>\u00a0<\/span>to keep the advanced file system features and file metadata through the transfer (see<span>\u00a0<\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Extended_file_attributes\">Extended attributes<\/a>). Extended attributes must be supported by both systems.<\/p>\n<p>Set<span>\u00a0<\/span><em>Delay Updates<\/em><span>\u00a0<\/span>to save the temporary files from updated files to a holding directory until the end of the transfer when all transferred files are renamed into place.<\/p>\n<p>Additional<span>\u00a0<\/span><a href=\"https:\/\/rsync.samba.org\/ftp\/rsync\/rsync.html\">rsync<\/a><span>\u00a0<\/span>options can be included in<span>\u00a0<\/span><em>Auxiliary Parameters<\/em>. Separate entries by pressing<span>\u00a0<\/span><kbd>Enter<\/kbd>. The<span>\u00a0<\/span><em>* character must be escaped with a backslash (\\<\/em>.txt) or used inside single quotes (&#8216;*.txt\u2019).<\/p>\n<p>Unsetting<span>\u00a0<\/span><em>Enabled<\/em><span>\u00a0<\/span>disables the task schedule. You can still save the rsync task and run it manually.<\/p>\n<h3 id=\"rsync-mode-ssh\">Rsync Mode: SSH<a aria-hidden=\"true\" href=\"https:\/\/www.truenas.com\/docs\/hub\/tasks\/scheduled\/rsync\/#rsync-mode-ssh\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" fill=\"currentColor\" width=\"24\" height=\"24\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"><\/path><path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"><\/path><\/svg><\/a><\/h3>\n<p>Using the<span>\u00a0<\/span><em>SSH<\/em><span>\u00a0<\/span>rsync mode requires the SSH service to be enabled on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. To enable SSH, go to<span>\u00a0<\/span><strong>Services<\/strong><span>\u00a0<\/span>and click the slider for SSH. SSH settings can be configured by clicking<span>\u00a0<\/span><i class=\"fas fa-pen\" aria-hidden=\"true\" title=\"Pen\"><\/i>. Take note of the TCP port set on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. The default port for the SSH service is port<span>\u00a0<\/span><em>22<\/em>. It is required when creating the rsync task.<\/p>\n<p>Now, an ssh key pair must be created on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system. Open up the<span>\u00a0<\/span><strong>Shell<\/strong><span>\u00a0<\/span>on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system. To create the ssh key pair, the<span>\u00a0<\/span><code>ssh-keygen<\/code><span>\u00a0<\/span>command is used. Typically, the rsync task is ran as the root user. If running the command as a different user, run<span>\u00a0<\/span><code>su -<span>\u00a0<\/span><i>username<\/i><\/code><span>\u00a0<\/span>where<span>\u00a0<\/span><em>username<\/em><span>\u00a0<\/span>is the name of the user that will run the rsync task. When the appropriate user is selected, run the command<span>\u00a0<\/span><code>ssh-keygen -t rsa<\/code><span>\u00a0<\/span>and follow the prompts. When prompted for a password, press<span>\u00a0<\/span><kbd>Enter<\/kbd>. Setting a password will break the scheduled rsync task since it is automatic. Below is an example of running the command.<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">truenas# ssh-keygen -t rsa\nGenerating public\/private rsa key pair.\nEnter file in which to save the key <span>(<\/span>\/root\/.ssh\/id_rsa<span>)<\/span>:\nCreated directory <span>'\/root\/.ssh'<\/span>.\nEnter passphrase <span>(<\/span>empty <span>for<\/span> no passphrase<span>)<\/span>:\nEnter same passphrase again:\nYour identification has been saved in \/root\/.ssh\/id_rsa.\nYour public key has been saved in \/root\/.ssh\/id_rsa.pub.\nThe key fingerprint is:\nSHA256:NZMgbuPvTHeEqi3SA\/U5wW8un6AWrx8ZsRQdbJJHmR4 tester@truenas.local\nThe key<span>'<\/span>s randomart image is:\n+---<span>[<\/span>RSA 2048<span>]<\/span>----+\n<span>|<\/span>      . <span>o<\/span><span>=<\/span>o+     <span>|<\/span>\n<span>|<\/span>     . .ooE.     <span>|<\/span>\n<span>|<\/span>      +.o<span>==<\/span>.     <span>|<\/span>\n<span>|<\/span>     o.oo+.+     <span>|<\/span>\n<span>|<\/span>     ...S+. .    <span>|<\/span>\n<span>|<\/span>    . ..++o.     <span>|<\/span>\n<span>|<\/span>     o oB+. .    <span>|<\/span>\n<span>|<\/span>    . <span>=<\/span>Bo+.o     <span>|<\/span>\n<span>|<\/span>     <span>o<\/span><span>+==<\/span>oo      <span>|<\/span>\n+----<span>[<\/span>SHA256<span>]<\/span>-----+\n<\/code><\/pre>\n<\/div>\n<p>The default location for the public key is<span>\u00a0<\/span><code>~\/.ssh\/id_rsa.pub<\/code>. Run the command<span>\u00a0<\/span><code>cat ~\/.ssh\/id_rsa.pub<\/code><span>\u00a0<\/span>to view the key. Copy it to the corresponding user account on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system in<span>\u00a0<\/span><strong>Accounts &gt; Users<\/strong>. Click<span>\u00a0<\/span><em>EDIT<\/em><span>\u00a0<\/span>and paste the key in the<span>\u00a0<\/span><em>SSH Public Key<\/em><span>\u00a0<\/span>field.<\/p>\n<p>Next, copy the host key of the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>to the user\u2019s<span>\u00a0<\/span><code>.ssh\/known_hosts<\/code><span>\u00a0<\/span>directory on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system. This is done using the<span>\u00a0<\/span><code>ssh-keyscan<\/code><span>\u00a0<\/span>command. While on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system, open up the<span>\u00a0<\/span><strong>Shell<\/strong><span>\u00a0<\/span>and run<span>\u00a0<\/span><code>ssh-keyscan -t rsa<span>\u00a0<\/span><i>remoteIPaddress<\/i><span>\u00a0<\/span>\u00bb<span>\u00a0<\/span><i>userknown_hostsDir<\/i><\/code><span>\u00a0<\/span>where<span>\u00a0<\/span><em>remoteIPaddress<\/em><span>\u00a0<\/span>is the IP address of the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system and<span>\u00a0<\/span><em>userknown_hostsDir<\/em><span>\u00a0<\/span>is the known_hosts directory on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>system. Here is an example of the command:<span>\u00a0<\/span><code>ssh-keyscan -t rsa 192.168.2.6 &gt;&gt; \/root\/.ssh\/known_hosts<\/code>.<\/p>\n<p>Finally, the rsync task is ready to be created. Go to<span>\u00a0<\/span><strong>Tasks &gt; Rsync Tasks<\/strong><span>\u00a0<\/span>and click<span>\u00a0<\/span><em>ADD<\/em>. Select the source dataset to be used for the rsync task. This dataset will be copied to the remote path chosen when<span>\u00a0<\/span><em>pushing<\/em>. Alternatively, this dataset will be used as the destination when<span>\u00a0<\/span><em>pulling<\/em><span>\u00a0<\/span>data from the remote path. Select the user to run the rsync task. Make sure this is the same user the ssh key pair was created for. In the example given, the user is root. Choose a direction for the rsync task. When<span>\u00a0<\/span><em>push<\/em><span>\u00a0<\/span>is selected, data from the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset copies to the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>dataset. When<span>\u00a0<\/span><em>pull<\/em><span>\u00a0<\/span>is selected, data from the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>dataset is copied into the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset. An optional description can be specified. Select a schedule for the rsync task. If a custom schedule is desired, select<span>\u00a0<\/span><em>Custom<\/em><span>\u00a0<\/span>and fill out the custom scheduler to meet your needs. The custom scheduler can accept standard<span>\u00a0<\/span><a href=\"https:\/\/www.freebsd.org\/cgi\/man.cgi?query=crontab&amp;sektion=5\">cron input strings<\/a><span>\u00a0<\/span>for the<span>\u00a0<\/span><em>Minutes<\/em>,<span>\u00a0<\/span><em>Hours<\/em>, and<span>\u00a0<\/span><em>Days<\/em>. By default, the<span>\u00a0<\/span><em>Recursive<\/em><span>\u00a0<\/span>option is set. If unset, the rsync task will not copy any subdirectories in the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset.<\/p>\n<p>Next, enter the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>host IP address or hostname. Use the format<span>\u00a0<\/span><em>username@remote_host<\/em><span>\u00a0<\/span>if the username differs on the<span>\u00a0<\/span><em>remote<\/em>host. Select<span>\u00a0<\/span><em>SSH<\/em><span>\u00a0<\/span>in the<span>\u00a0<\/span><em>Rsync Mode<\/em><span>\u00a0<\/span>dropdown. Enter the<span>\u00a0<\/span><em>TCP port<\/em><span>\u00a0<\/span>set on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. The default is<span>\u00a0<\/span><em>22<\/em>. Enter the remote path of the dataset for rsync to<span>\u00a0<\/span><em>push<\/em><span>\u00a0<\/span>or<span>\u00a0<\/span><em>pull<\/em>. Set<span>\u00a0<\/span><em>Validate Remote Path<\/em><span>\u00a0<\/span>to automatically create the defined<span>\u00a0<\/span><em>Remote Path<\/em><span>\u00a0<\/span>if it does not exist on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system.<\/p>\n<p>Setting the<span>\u00a0<\/span><em>Times<\/em><span>\u00a0<\/span>option preserves modification times of the files. Set<span>\u00a0<\/span><em>Compress<\/em><span>\u00a0<\/span>to reduce the size of data to transmit. This is recommended for slow connections.<span>\u00a0<\/span><em>Archives<\/em><span>\u00a0<\/span>can be set to run recursively, preserving symlinks, permissions, modification times, group, and special files. When run as root, the owner, device files, and special files are also preserved. This is equivalent to passing the flags<span>\u00a0<\/span><code>-rlptgoD<\/code><span>\u00a0<\/span>to rsync. When<span>\u00a0<\/span><em>Delete<\/em><span>\u00a0<\/span>is set, the rsync task will delete files in the destination directory that do not exist in the source directory. For example, if the task is set to<span>\u00a0<\/span><em>pull<\/em>, this option will delete any files on the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset that do not existing on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>module. Alternatively, if the task is set to<span>\u00a0<\/span><em>push<\/em>, this option will delete any files on the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>module that are not in the<span>\u00a0<\/span><em>host<\/em><span>\u00a0<\/span>dataset. This is a<span>\u00a0<\/span><strong>destructive<\/strong><span>\u00a0<\/span>option. Use with caution as data can be deleted permanently. Set the<span>\u00a0<\/span><em>Quiet<\/em><span>\u00a0<\/span>option to suppress informational messages from the<span>\u00a0<\/span><em>remote<\/em><span>\u00a0<\/span>system. Set the option<span>\u00a0<\/span><em>Preserve Permissions<\/em><span>\u00a0<\/span>to preserve original file permissions. This is useful when the user is set to root. Set<span>\u00a0<\/span><em>Preserve Extended Attributes<\/em><span>\u00a0<\/span>to keep the advanced file system features and file metadata through the transfer (see<span>\u00a0<\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Extended_file_attributes\">Extended attributes<\/a>). Extended attributes must be supported by both systems. Set<span>\u00a0<\/span><em>Delay Updates<\/em><span>\u00a0<\/span>to save the temporary files from updated files to a holding directory until the end of the transfer when all transferred files are renamed into place.<\/p>\n<p>Additional<span>\u00a0<\/span><a href=\"https:\/\/rsync.samba.org\/ftp\/rsync\/rsync.html\">rsync(1)<\/a><span>\u00a0<\/span>options can be included in<span>\u00a0<\/span><em>Auxiliary Parameters<\/em>. Separate entries by pressing<span>\u00a0<\/span><kbd>Enter<\/kbd>. The<span>\u00a0<\/span><em>* character must be escaped with a backslash (\\<\/em>.txt) or used inside single quotes (&#8216;*.txt\u2019).<\/p>\n<p>Unsetting<span>\u00a0<\/span><em>Enabled<\/em><span>\u00a0<\/span>disables the task schedule. You can still save the rsync task and run it manually.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configuring an rsync Task How to configure automated data transfers using rysnc. \u00a0 9 minute read Data often needs to be copied to another system for backup or when migrating to a new system. A fast and secure way of doing this is by using rsync. Rsync provides the ability to either\u00a0push\u00a0or\u00a0pull\u00a0data. When using rsync [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-630","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/posts\/630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/comments?post=630"}],"version-history":[{"count":0,"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/posts\/630\/revisions"}],"wp:attachment":[{"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/media?parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/categories?post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mastercom.es\/en\/wp-json\/wp\/v2\/tags?post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}