{"id":10647,"date":"2024-01-16T13:02:00","date_gmt":"2024-01-16T18:02:00","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=10647"},"modified":"2024-01-16T13:02:00","modified_gmt":"2024-01-16T18:02:00","slug":"rsync-to-mirror-local-files","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=10647","title":{"rendered":"RSync to Mirror Local Files"},"content":{"rendered":"<p>The rsync utility was <em>meant<\/em> to be used to sync files across the network &#8212; to or from an rsync <em>server<\/em>. For some time, I had a group of friends who shared documents off of my rsync server. Anyone with access could run an rsync command and sync their computer up with the group&#8217;s documents. With the advent of online file storage and collaborative editing, this was no longer needed. But I still use rsync to make sure my laptop has a local copy of a folder on the server. Mount \/path\/to\/folder\/contents\/to\/copy to the SMB or NFS share, and the following rsync command ensures the laptop&#8217;s \/path\/to\/where\/contents\/should\/be\/placed has an exact mirror of the contents of the server folder<\/p>\n<p>rsync &#8211;archive &#8211;verbose &#8211;update &#8211;delete &#8220;\/path\/to\/folder\/contents\/to\/copy\/&#8221; &#8220;\/path\/to\/where\/contents\/should\/be\/placed\/&#8221;<\/p>\n<p>&#8211;archive is a grouping of:<br \/>\n-r recursive<br \/>\n-l copy symlinks<br \/>\n-p preserve permissions<br \/>\n-t preserve modification timestamps<br \/>\n-g preserve group<br \/>\n-o preserve owner<br \/>\n&#8211;devices preserve device files (su only)<br \/>\n&#8211;specials preserve special files<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The rsync utility was meant to be used to sync files across the network &#8212; to or from an rsync server. For some time, I had a group of friends who shared documents off of my rsync server. Anyone with access could run an rsync command and sync their computer up with the group&#8217;s documents. &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[632,294,1967],"class_list":["post-10647","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-bash","tag-linux","tag-rsync"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10647"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10647\/revisions"}],"predecessor-version":[{"id":10648,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10647\/revisions\/10648"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}