{"id":911,"date":"2019-11-13T13:21:48","date_gmt":"2019-11-13T00:21:48","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=911"},"modified":"2020-01-07T16:13:35","modified_gmt":"2020-01-07T03:13:35","slug":"using-rsync-sync-some-local-directories-to-remote-directory-via-ssh","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=911","title":{"rendered":"Using RSYNC to Sync Some Local Directories to Remote Directory via SSH"},"content":{"rendered":"<p><strong>Requirement<\/strong><\/p>\n<ul>\n<li>SSH Server on Remote Computer<\/li>\n<\/ul>\n<p><strong>Syntax<\/strong><\/p>\n<p>To sync some of your <strong>local directories<\/strong> to a <strong>remote directory<\/strong> via <strong>ssh<\/strong> you can use the following syntax:<\/p>\n<pre style=\"white-space: pre;\">rsync -av -L --delete -e ssh &lt;DIR1&gt;[[ &lt;DIR2&gt;] &lt;DIRn&gt;] &lt;REMOTE_USER&gt;@&lt;REMOTE_HOST&gt;:&lt;REMOTE_DIR&gt;<\/pre>\n<table>\n<tbody>\n<tr>\n<td><strong>Token<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>DIR1, DIR2, DIRn<\/td>\n<td>These are the local directories you've wanted to be synced remotely. Only DIR1 is required and the rest are optional.<\/td>\n<\/tr>\n<tr>\n<td>REMOTE_USER<\/td>\n<td>A valid user on the remote machine.<\/td>\n<\/tr>\n<tr>\n<td>REMOTE_HOST<\/td>\n<td>A valid address of the remote machine.<\/td>\n<\/tr>\n<tr>\n<td>REMOTE_DIR<\/td>\n<td>The destination directory on the remote machine.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Example<\/strong><\/p>\n<pre style=\"white-space: pre;\">rsync -av -L --delete -e ssh \/data\/artifactory backup01@10.0.0.204:\/volume1\/backup<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Requirement SSH Server on Remote Computer Syntax To sync some of your local directories to a remote directory via ssh you can use the following syntax: rsync -av -L &#8211;delete -e ssh &lt;DIR1&gt;[[ &lt;DIR2&gt;] &lt;DIRn&gt;] &lt;REMOTE_USER&gt;@&lt;REMOTE_HOST&gt;:&lt;REMOTE_DIR&gt; Token Description DIR1, DIR2, DIRn These are the local directories you&#8217;ve wanted to be synced remotely. Only DIR1 is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[55,28],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/911"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=911"}],"version-history":[{"count":3,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/911\/revisions"}],"predecessor-version":[{"id":1037,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/911\/revisions\/1037"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}