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
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 />

Revision as of 22:06, 28 August 2015


Mac

$ 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