Cache - ability to purge directory cache without purging cached files?

Will it be possible to expire directory information without losing all the cached chunks?

Sometimes I want to flush just a directory as it’s out of sync with another VPS that has the same mount but it’s not ideal to flush 100G of commonly used plex file chunks (usually last few weeks of added files).

Thanks

What would you suggest - another flag instead of --cache-db-purge?

In this case, probably not a flag, as I’m invalidating with HUP signals via kill.

how about something like this:
first SIGHUP => purge cache directory listing
second SIGHUP during the next 1-2 seconds => also purge cached clusters from disk

Definitely a compromise yeah, so you’d invalidate both easily with killall -HUP rclone && killall -HUP rclone

another approach would be to implement some kind of managing interface. possibly a (rest) api listening on a specified interface:port with authentication (http basic authentication/token based?). What do you think @ncw? This would give us all possibilities to change parameters of a running rclone mount

Being able to tweak some mount parameters while it’s online sounds handy even outside of cache eviction.

I’ve thought about this before.

There are some basic things that people have asked for lots of times, eg being able to change the bwlimit on the fly.

Rclone has a web serving interface in cmd/serve/httplib which does all the hard parts (eg authentication, TLS etc).

What I imagine is that the user would need to provide the --rc flag (lets say) and if they did rclone would start a remote control server on a default port (or you could specify it).

Then we’d have an internal API so that potential users of the remote control could hook themselves into and out of it. That could include the “bwlimit” mentioned above as well as other things… The uers might register a subsystem, eg “bwlimit” and some commands for that subsystem, eg “get”, “set”.

The external API would be some REST-ish interface giving and returning JSON blobs most likely, though being able to be flexible to take things as parameter strings might be a good idea.

We’d then make an rclone command rclone rc maybe so you could act on the registered rpc, eg rclone rc bwlimit set 100k or rclone rc mount flush-cache.

What do you think?

i like it. additionally there could be a remote control web-ui in a second/third iteration, including monitoring, control, etc (single page, js/jQuery, ajax to rest api)

Does open the door to status pages for what’s in the upload cache, backend cache and vfs too I guess.

Thinking something similar to traefik’s small web UI.