Syncing Directories Between Mac and Windows: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "Category:MacOS Category:Windows == Mac == <syntaxhighlight lang="bash"> $ cd path/to/parent/of/directory/to/be/synced/ $ rsync -a /Volumes/share/path/to/src/ src </s...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:MacOS]] [[Category:Windows]]
[[Category:Mac OS]] [[Category:Windows]]


== Mac ==
== Mac ==
Line 15: Line 15:
$ rsync -anv /Volumes/share/path/to/src/ src
$ rsync -anv /Volumes/share/path/to/src/ src
</syntaxhighlight>
</syntaxhighlight>
'''Note''' that the trailing slash on the source path is important. With the slash the contents of the path are synced into the target directory. Without the slash the source directory itself is placed ''inside'' the target directory.<ref>[https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps How To Use rsync To Sync Local And Remote Directories On A VPS] - DigitalOcean</ref>
== Notes ==
<references />

Latest revision as of 05:33, 3 December 2015


Mac[edit]

$ cd path/to/parent/of/directory/to/be/synced/
$ rsync -a /Volumes/share/path/to/src/ src

The -a flag is recursive, and it preserves permissions.

To preview the operation, use the -n (dry-run) and -v (verbose) flags:

$ rsync -anv /Volumes/share/path/to/src/ src

Note that the trailing slash on the source path is important. With the slash the contents of the path are synced into the target directory. Without the slash the source directory itself is placed inside the target directory.[1]

Notes[edit]