I want to manually evict files from the vfs file content cache using an rclone remote command, but sadly I don't think this is possible?
I know about rclone rc vfs/forget
but it only forgets the directory or file metadata cache, not the contents.
The promising looking rclone rc cache/expire
command is only for the cache backend, not the vfs file cache.
I don't have a real user problem, per say, I am just doing some testing/benchmarking on rclone mount
and I want to be able to force a file and its contents to be expired/purged from the vfs cache. This lets me easily compare cached and non-cached behavior for the same files.
For my testing purposes the workarounds I've tried are:
- Turning off the cache with
--vfs-cache-mode=off
. This works but doesn't allow me to then easily compare vfs cached file behavior with non-cached file behavior on the same file. I want to test howrclone mount
performs in the cache mode I use it in. - Just renaming the file on the remote, doing
vfs/forget
, and then refreshing the directory. This works but is tedious and requires having the file name constantly in flux. - The best workaround for now is just manually deleting the file[s] from the vfs cache directory (
~/Library/Caches/rclone/vfs/<remote>/...
on macOS by default). For this to work nicely I also need to usevmtouch -e <file>
to purge the file from the OS's in-memory file cache. This mostly works fine but I'm always nervous about doing this while rclone is running, particularly if its currently reading from the cache. But maybe it's fine?
To confirm, is there's no way using an rclone remote command (or otherwise) to force a file/directory to be purged from the vfs file cache? Assuming there's no alternative, are there any issues or risks with manually deleting files from the vfs cache directory while an rclone mount is running and might be using them?
Thanks!