Set Cache Limit or Expiration for S3FS
Asked Answered
H

3

6

I have this option "-o use_cache=/tmp" set when I mount my S3 bucket. Is there a limit on how much room it will try to use in tmp? Is there a way to limit that or otherwise expire items after X amount of time?

Hildy answered 20/1, 2015 at 5:3 Comment(1)
That would be a great add-on.Crack
U
2

You could use the (unsupported) sample_delcache.sh script from the s3fs-fuse project. Set up a cron job to run it every so often. There'd still be the risk of running out space (or inodes, as I just did) before the next time you ran the cleanup script, but you should be able to dial it in.

Unreason answered 29/4, 2016 at 21:37 Comment(0)
P
2

At this time there is an option ensure_diskfree to preserve some space.

Pyemia answered 20/3, 2018 at 9:53 Comment(0)
H
1

The local cache's growth is apparently unbounded but it is truly a "cache" (as opposed to what might be called a "working directory") in the sense that it can be safely purged at any time, such as with a cron job that removes files after a certain age, combining find and xargs and rm.

(xargs isn't strictly necessary, but it avoids issues that can occur when too many files are found to remove in one invocation.)

Hg answered 20/1, 2015 at 16:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.