Keeping two Directories in perfect sync!

Hi Guys,

I seem to be asking for a lot of help this week, but you are all amazing people so I hope you don’t mind!

I need to find a way to keep my google drive and icloud drive in sync with each other. This is because on my work computer I am unable to install icloud, and I really do not want to work out of google drive due to the limitations of the app with the office suite on ios.

Any ideas of how to do this? The tools I have at my disposal are:
Macbook
iMac
Windows 10 (Home PC)
Windows Server 2016
Synology NAS

My initial thought was using something like ITTT or Zapier but they didn’t have the functionality, then I tried with CCC but that just argued with its self and ended up deleting everything as everytime a file updated in one, it tied to sync it back to other (eg if I updated a file into Gdrive then CCC would force Gdrive back to the same state as iCloud Drive rather then update icloud drive).

Mind hurts now!

rsync!

Here's the tldr of the man page
rsync

Transfer files either to or from a remote host (not between two remote hosts).
Can transfer single files, or multiple files matching a pattern.

- Transfer file from local to remote host:
    rsync path/to/file remote_host_name:remote_host_location

- Transfer file from remote host to local:
    rsync remote_host_name:remote_file_location local_file_location

- Transfer file in archive (to preserve attributes) and compressed (zipped) mode:
    rsync -az path/to/file remote_host_name:remote_host_location

- Transfer a directory and all its children from a remote to local:
    rsync -r remote_host_name:remote_folder_location local_folder_location

- Transfer only updated files from remote host:
    rsync -ru remote_host_name:remote_folder_location local_folder_location

- Transfer file over SSH and show progress per file:
    rsync -e ssh --progress remote_host_name:remote_file local_file

- Transfer file over SSH and show global progress:
    rsync -e ssh --info=progress2 remote_host_name:remote_file local_file

I currently have this for my local Documents folder syncing with iCloud and my 2 external hard drives instead of Documents in the Cloud and Time Machine.

This is what I usually run.

rsync -av --exclude=.git --exclude=Dropbox --exclude=Creative\ Cloud\ Files --exclude=Informal\ Art\ Portfolio --exclude=.idea --exclude=venv --exclude=node_modules --exclude=.sass-cache --exclude=.class --exclude=out --exclude=.DS_Store --exclude=.Trashes --exclude=.TemporaryItems --exclude=.cache --exclude=sass --exclude=flowboard.com --exclude=Spring2018 ~/Documents ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/MyStuff

Essentially -a means use archive mode, -v means verbose and the series of --exclude's are for excluding those files and folders from syncing.

Important: ~/Documents means copy a Documents folder and all of it’s contents. ~/Documents/ means copy all of the contents of a the folder.

You’d need to use this in conjunction with something like https://mountainduck.io for local modification of Google Drive,

Thanks for the speedy response!

Trying to understand that, correct me if I am wrong, but isn’t that only one way?

AKA push all of the Documents to iCloud/MyStuff?

Also, why would I need Mountain?

For rsync:
It is only one way and would require running in both directions. It’s my understanding that Google drive cannot be accessed from Finder. Mountain duck is a service that lets you essentially mount cloud services as an external drive.

Other option:
I remembered looking at Transmit by Panic a couple months ago and just relooked. I found this which seems to be exactly what you’re looking for.

Transmit looks perfect! Thank you! Will report back!

1 Like

Chronosync would do this, unless you needed to run it from your Windows machine(s).

1 Like

How is this going to manage the fact that iCloud paths are not the actual file system path?

e.g. ~/Library/Mobile Documents/3N3RG282KZ~com~indeeo~iDraw/Documents/ appears as ~/iCloud Drive/Graphic in the Finder

Pointing Chronosync to the iCloud Drive folder itself seems to only sync user-created folders there, not the ones created by apps.

On the Google side you are likely to run into some of the problems described here:

With two ordinary folders, Chronosync (or Transmit or rsync) would be easy to set up but I think you may be asking for unnecessary trouble by choosing to use iCloud and Google Drive for this process.

1 Like

Hmmmm… I tried to set up a sync, and you’re right. Only the files I’ve put there from non-Apple apps were synced.

If this is what the OP wants, it could work, but if the OP really wants the entire shebang, Chronosync isn’t going to do the job.