{"id":360,"date":"2013-03-04T13:46:55","date_gmt":"2013-03-04T13:46:55","guid":{"rendered":"http:\/\/vickistan.com\/?p=360"},"modified":"2016-08-19T19:18:25","modified_gmt":"2016-08-19T19:18:25","slug":"rsync","status":"publish","type":"post","link":"https:\/\/vickistan.com\/?p=360","title":{"rendered":"Rsync Commands"},"content":{"rendered":"<p>rsync -avnh source target<\/p>\n<p>#Use rsync to sync to remote system as user over remote shell compressing transfer and without crossing filesystem boundaries<br \/>\nrsync -avzx -e ssh \/var\/www\/ user@remote_host:\/var\/www\/<\/p>\n<p>#Use rsync to sync to remote system as user over remote shell skipping files that are newer on the remote server<br \/>\nrsync -avzxu -e ssh \/var\/www\/ user@remote_host:\/var\/www\/<\/p>\n<p>Pushing files with rsync<br \/>\nrsync -a ~\/dir1 user@remote_host:\/var\/www\/<\/p>\n<p>Pulling files with rsync<br \/>\nrsync -a user@remote_host:\/home\/user\/dir1 \/var\/www<\/p>\n<p>#To see which files need to be synced:<br \/>\nrsync -n &#8211;dry-run -av \/var\/www\/vhosts\/domain.com\/. remote_host:\/var\/www\/vhosts\/domain.com\/.<\/p>\n<p>&nbsp;<\/p>\n<p>-a = archive which basically means use recursion and preserve symbolic links, devices, attributes, permissions, ownerships, etc.(not hard links)<br \/>\n-v = verbose<br \/>\n-z = compression<br \/>\n-n = dry run<br \/>\n-h = human readable<br \/>\n-P = progress bar for the transfers and allows you to resume interrupted transfers<br \/>\n-u = skip files that are newer on the receiver<br \/>\n&#8211;delete option allows deletions from destination if not in source<br \/>\n&#8211;dry-run<br \/>\n&#8211;exclude=pattern_to_exclude excludes items matching the pattern (Good practice to run with &#8211;dry-run first to be sure)<\/p>\n<p>* By default, rsync does not delete anything from the destination directory.<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>rsync -avnh source target #Use rsync to sync to remote system as user over remote shell compressing transfer and without crossing filesystem boundaries rsync -avzx -e ssh \/var\/www\/ user@remote_host:\/var\/www\/ #Use rsync to sync to remote system as user over remote &hellip; <a href=\"https:\/\/vickistan.com\/?p=360\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-360","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=360"}],"version-history":[{"count":14,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":803,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/360\/revisions\/803"}],"wp:attachment":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}