Keep local and gdrive aligned (smart sync)

Hi, I’m looking for something that synchronise a local folder and google drive folder keeping the content aligned in both direction: so is not mirroring but real sync.
I mean I can change something locally and I want to have the change propagated to gdrive but I want also that something changed on gdrive is aligned locally.

There is a rclone command suitable for this?

rclone sync and rsync are one directional to my knowledge so you’d need something different to achieve what you are looking for.

  • You could mount the GD local and just write everything there and keep them in sync

I’ve used https://syncthing.net/ for that before when I had separate machines that I wanted to keep things synchronized.

rclone doesn’t have a 2-way sync at the moment.

You could try this script: https://github.com/cjnaz/rclonesync-V2

I’d like to build something similar into rclone at some point

Are you sure that rsync cannot perform the sync like I’m looking for?
I thought it’s able.

@ncw thanks, I’m reading your script. Some options from rclone aren’t available from your script but I will try to pass them to the rclone script.
Now I’m facing issue running py script: “Cannot find prior Path1 or Path2 lsl files.”
Both rclone lsl {path1} and rclone lsl {path2} runs fine and rclonesynch.py print Path1 and Path2 correctly when executed but fails with the above error.
I’ll check.
Thanks

It can't do it yet, sorry!

I didn't write the script that was @cjnaz :smiley:

Regarding

“Cannot find prior Path1 or Path2 lsl files.”

, RTFM. You are looking for --first-sync, and there are several other things you probably want to understand.

Regarding

Some options from rclone aren’t available from your script but I will try to pass them to the rclone script. , rclonesync currently does not support passing rclone switches via the command line.

Your best best is to set rclone environment variables. See https://rclone.org/docs/#environment-variables. Please DO reply with what rclone switches you wish to use. For rclonesync, I'm considering a pass-through --rclone-switches "", but its not so simple in that several rclone commands are used within rclonesync, and not all rclone switches are appropriate for all rclone commands.