Two way SYNC with Google Drive

When running:

$ rclone sync googledrive:REMOTE_FOLDER LOCAL_FOLDER

If files are modified under LOCAL_FOLDER they would be updated under REMOTE_FOLDER.

Currently, sync is just a glorified copy:
“sync Make source and dest identical, modifying destination only.”
“copy Copy files from source to dest, skipping already copied”

Is there a question? Sync is just a copy with a included delete for anything on on the dest…

They wouldn’t, as REMOTE_FOLDER is your destination, not the source.

If you want to keep two locations in sync, just use copy from A to B, and from B to A?

This will for sure create a big mess ans assure you A LOT of data loss!

Sync is not only copy A -> B then copy B -> A because you have to consider what to do in case of files deleted or different versions of the same file.

There could be many problems, the most common 2 would be:

  1. B has the same file than A, but the B version is newer than A; in the 1st pass copy A -> B you suggest, the newer file would be overwritten by the older. Just tried, here you get the outputs:

    $ ls A/ -lah
    -rw-rw-r-- 1 marco marco 12 giu 28 00:31 prova
    $ ls B/ -lah
    -rw-rw-r-- 1 marco marco 24 giu 28 00:32 prova
    $ rclone copy B/prova asdyt:/
    $ rclone -v copy A/prova asdyt:/
    2017/06/28 00:32:59 INFO : Google drive root ‘’: Modify window is 1ms
    2017/06/28 00:33:00 INFO : Google drive root ‘’: Waiting for checks to finish
    2017/06/28 00:33:00 INFO : Google drive root ‘’: Waiting for transfers to finish
    2017/06/28 00:33:01 INFO : prova: Copied (replaced existing)
    2017/06/28 00:33:01 INFO :
    Transferred: 12 Bytes (7 Bytes/s)
    Errors: 0
    Checks: 1
    Transferred: 1
    Elapsed time: 1.6s

Boom! Newer file overwritten! Data loss!

  1. Sync is also deleting files, but doing 2 pass copy create a big mess: if you’ve deleted a file from B, the 1st pass copy A -> B would create the same file again; if you’ve deleted a file from A, the 2nd pass copy B -> A would create the deleted file, again and again… you won’t ever succeed in removing a file.

On the other side if you use the --delete option, the 1st pass copy A -> B will delete a file that has been created on B but it’s now on A.

Sync is much more complicated than just issuing 2 copy commands.

1 Like