I use rsync (included with the OS) for syncing my MBP and virtual machines with the main desktop Mac. You set up an /etc/rsyncd.conf file on the main machine, with your chosen paths you want synced defined there (owner root:wheel, permissions 640). Then a simple shell script on the client Mac's will sync all of those paths (or just selected ones, as I do in the case of the VM's).
Here is one line from my /etc/rsyncd.conf
Code:
[Documents]
path = /Users/henry/Documents
And here is the corresponding line in the script file on the client:
Code:
/usr/bin/rsync -rt --delete helios::Documents /Users/henry/Documents
Note, the target directory on the client need not be pathed the same as it is on the server. In my case, they all are the same.
man rsync will give you all the options for the client script. The syntax for rsyncd.conf on the server machine is here:
https://rsync.samba.org/ftp/rsync/rsyncd.conf.html
rsycd must be run as a daemon on the server, and ssh with key authentication must be set up between the two machines to be synced (something I do anyway to all local machines). It may sound complicated, but once it's all set up, it is simply a matter of invoking the shell script on the client to sync everything. I keep my config files saved, and use the same ones on the next version of macOS.
Here is rsync.plist, which goes into /Library/LaunchDaemons, owner root:wheel, permissions 644.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>rsync</string>
<key>Program</key>
<string>/usr/bin/rsync</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/rsync</string>
<string>--daemon</string>
</array>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>rsync</string>
<key>SockType</key>
<string>stream</string>
</dict>
</dict>
</dict>
</plist>
Then launch the daemon thus:
Code:
sudo launchctl load -w /Library/LaunchDaemons/rsync.plist