Feature Request: rclone changes command - Efficiently detect file changes

Hi everyone,

I'd like to propose a new command for rclone: rclone changes. This command would leverage a "ChangeNotify" mechanism (common in many backend implementations) to efficiently retrieve a list of paths that have been modified since a given point in time.

Background:

While experimenting with building my own rclone backend, I encountered a useful feature called "ChangeNotify." This mechanism allows querying for changes (creations, modifications, deletions) that have occurred within a storage system after a specific timestamp. I understand that rclone uses something similar internally; for example, the mount command uses it to keep its view of the remote filesystem up-to-date efficiently. ChangeNotify can be a valuable tool for efficiently tracking changes in a storage system.

Proposed Command:

I'm suggesting exposing this functionality as a command-line tool: rclone changes.

Example Usage:

rclone changes GoogleDrive: --from "2025-03-29T08:49:56.205Z" --json

Expected Output:

The command would output a JSON list of file paths that have changed since the --from timestamp. For example:

[
  { "path": "path/to/file1.txt" },
  { "path": "path/to/directory/file2.jpg" },
  { "path": "another/file3.pdf" }
]

Use Case & Benefits:

My primary use case involves syncing metadata from a remote to a destination remote. I only need to sync the metadata, not the file content itself. Currently, I use rclone lsjson to get a listing of the source remote and then manually compare it to the destination. I can't use the rclone sync command directly because I don't want to sync the file contents.

To keep the two remotes in sync, I have to run lsjson periodically and compare the results. This is inefficient, especially when relatively few files have changed.

The rclone changes command would provide a much more efficient way to identify only the files that need to have their metadata updated on the destination. Instead of a full listing and comparison, I could simply:

  1. Use rclone changes to get a list of modified paths.
  2. Update only the metadata for those specific files on the destination remote.

This would significantly reduce the overhead of keeping the two systems synchronized, especially for large remotes with infrequent changes.

Am I Missing an Existing Solution?

I also wanted to ask: Is there already a way to accomplish this with existing rclone commands or configurations that I'm simply overlooking? I'm open to the possibility that I might be misunderstanding the best way to use rclone for my use case (syncing metadata only). If anyone has suggestions or alternative approaches, I'd greatly appreciate your insights!

I'm interested to hear your thoughts and feedback on this proposal! Thanks for considering it.

that would be nice.


actually, afiak

  • very few backends have ChangeNotify - gdrive, onedrive and ???
  • wrapped remotes do not support it, such as union.

well, there is rclone test changenotify

Hey Jojo the human monkey, thanks for the response! Lovely name, by the way!

FYI, here's a list of backends implementing ChangeNotify: dropbox, box, onedrive, pixeldrain, drive (and some middleware backends: cache, chunker, combine, compress, cryptdrive, hasher, union).

While the number of backends supporting ChangeNotify might seem small, they represent a significant portion of the market, including major providers like OneDrive, GDrive, and Dropbox. I don't have exact figures, but I believe the coverage is quite substantial.

Thanks for pointing out the rclone test changenotify command! I wasn't aware of it.

However, after considering it, the current implementation of the ChangeNotify function wouldn't readily support the feature I proposed, as it isn't stateless. Specifically, the function doesn't allow specifying a starting time; instead, it begins monitoring from the moment it's initiated and pools indefinitely from that point forward.

Interesting. Quotaless.cloud is rolling out this feature. I thought about using it against the VFS cache via the rclone rc command. But it looks like the rc command doesn't let you add an object to the VFS cache. @ncw

the monkey in me is grateful for the comment. alas, the human in me is ... ;wink


yeah, you are correct. the last time i looked into it, there were just a few and wrapped remotes had issue.


too bad, it would have been a good addition to rclone.

1 Like