Is it bad to delete files from vfs cache manually without restarting rclone?

I run a rclone mount and use the cloud storage just as backup, wanting to have everything in cache locally, so when the cache eventually fills to 100%, I reorganize the files in a way that will fit the local space but then I need to wipe it from cache, i usually would do that just deleting the files from vfsMeta and vfs folders outside rclone but now that I think about automating this more I wonder if it’s bad to do this with rclone running and not restarting it ? if could cause any bugs or issues

Perhaps there is something like vfs/forget rc command that actually deletes the files locally too? I couldn't find this in documentation

1 Like

the bad thing is rclone dont have correct read amount of cache since u delete it manually

1 Like

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

yeah, exactly why i'm asking since idk how rclone will really handle it. i usually restart the service after deleting the files manually but it would be great if @ncw could give us a rc command to evict files from cache as it would allow automation and scripting with safety

1 Like

Wouldn’t running rc vfs/refresh achieve exactly what you want? What is the reason to try to tinker with cache content manually?

1 Like

hi @kapitainsky,

rc vfs/refresh applies to the vfs dir cache.

the OP wants a new command to evict files from the vfs file cache

I use rc vfs/refresh with caches where --vfs-cache-max-age is set to very long time period for exactly that. When file is detected as already not existing in the remote it is evicted from both dir cache and from content cache.

I am not sure I fully understand OP requirement. Rclone can manage cache itself, its max size can be configured and transparently oldest content is deleted when not needed.

1 Like

good point, for remotes that support polling.


a safe way to evict individual files from the file cache, on demand.

1 Like

@random404 What do you need this functionality for? What is the problem you are trying to resolve?

Especially what in existing automatic cache content management does not fit into what you are trying to do?

Currently there is no way to remove a previously cached content unless you manually delete it. rc vfs/refreshonly refresh the cache, it does not delete things on disk. The goal is not to update cache, but rather, delete what is known to be 100% stale/old data that have been cached and we want to get rid of it without having to restart rclone

I push new content to all servers = all servers share the same remote, but from my software I control which server will access what, so when content gets old I balance it between my servers, but all the other servers would still have the files cached too and there is no way to get rid of it unless manually deleting it.

The disks are always at ~100% utilization so being able to reduce cloud use as much as possible is good for both safety, speed, reliability and cost.

It is no difference from cloudflare like cache rules, there should be always a way to purge something from cache when we want

I propose to change vfs/forget to be a command that will clear cache and also delete if already exists, or creating something like vfs/delete

3 Likes

Agreed with @random404. I am currently having to manually wipe the VFS folders and restart rclone to get it to 'notice' my freed-up space. It’s a bit of a clunky workaround. A proper command to evict specific files/folders from the content cache (while leaving them on the cloud) would be a huge help to me

1 Like

yeah @ncw any hope we can get some love? perhaps i can help with a 150$ bounty ( i have no idea how easy is to implement something like this )

It’s better to delete files manually from the vfs/ and vfsMeta/ folders when running mount without worrying about work.

1 Like