Control cache directory usage?

Is it possible to control the cache directory usage to say to evict things from the cache (instead of adding) if total disk usage is over a certain amount.

example: I can limit my cache to 1TB, but what happens if its half full, and my total free disk space is only 250GB. will it fill up the 250GB?

i.e. I might want to specify that its limited to 1TB AND it shouldn't allow free diskspace to drop below 250GB. In the above case, it would essentially have a dynamic limit of 500GB and hence would have to evict things to add more things.

In practice, the way I do that now is to create a 1TB file that is loopback mounted on my cache dir (essentially preallocate the space), but its not the most efficient way to do it.

If your disk space is 250GB, setting your cache size to 1TB would be not correct as you don't have the disk space to facilitate that. You want to set your cache size to what you actually have on disk as there's no real magic here.

If you need to make a 1TB in cache, you need 1TB of disk space as the whole file needs to be there if you want to use the cache. There's no way around it as it is designed using sparse files and not chunks.

I have TBs of disk space. But as its on a shared partition (if I could repartition, I'd actually consider that, but not an option right now), so the free space fluctuates and don't want race conditions between rclone and other systems writing to the partition. as I said, the way I avoid that for now is a loopback mount (filesystem in a file).

Yes, however rclone has special handling to purge things from the cache if the disk becomes full.

Having a min free size limit would be possible too with a bit of work.

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