Sync to disk when change is detected on remote

Is it possible to have an script, that syncs the remote to disk, when changes are detected on the remote?

I have seen scripts doing the inverse i.e syncing to remote when changes are detected on disk so I was thinking if is it possible to do this too

The backend is google drive if that matters.


rclone sync remote: /path/to/local/folder
change remote: to the name of your remote.

Important : Since this can cause data loss, test first with the --dry-run flag to see exactly what would be copied and deleted.

I know about rclone sync...but unless I run it every second, it will not achieve what I want...

Also can't use an mount because the local folder already have files

you need to sync each and every second?

Yes. I want the local disk to mirror the remote as close to real-time as possible.

So obviously the best way would be to call rclone sync ONLY when it's found that an change happened

hmm then maybe this is yet another reason for me to prefer to serve my local folder with rclone instead of NFS.

My use case is that I want a setup like this:

  1. I do renaming, moving, all kind of files management with the cloud = remote1
  2. I have an union remote saying to read first from the cloud remote so applications are always reading the latest data
  3. I have enough disk space in another server in the local network to mirror the entire remote1 and serve it to other servers
  4. The local storage should be kept in sync as much as real time as possible and if remote1 fails, the union mount start reading from the NAS

This is what I have in mind. I just don't know yet if the backend will be rclone serve http + local disk storage or an NFS share

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.