I’m trying to save a lot of space (and money) by deleting files in a web server directory tree that can be regenerated on the fly by an HTTP request. The goal is to delete files that were not accessed in the last, let’s say, one month.
There are only two minor challenges.
1. Apache seems not to update atime on read
2. find -atime seems to update atime
I can explain the first issue with caching, and that would be okay in the long-term, but the second one seems a bit surprising. I mean, if it indeed updates atime, then it’s the most useless feature I’ve even run into on UNIX.
It’s even worse, as it seems to be random how many files are updated.
FreeBSD 12.1, ZFS, atime=on
PS: Yes, I’m aware that -atime 1m isn’t older than one month but younger than one minute. I was testing it
There are only two minor challenges.
1. Apache seems not to update atime on read
2. find -atime seems to update atime
I can explain the first issue with caching, and that would be okay in the long-term, but the second one seems a bit surprising. I mean, if it indeed updates atime, then it’s the most useless feature I’ve even run into on UNIX.
It’s even worse, as it seems to be random how many files are updated.
Code:
$ find . -atime -1m | wc
0 0 0
$ find . -atime -1m | wc
486 486 8056
$ find . | wc
745 745 20054
FreeBSD 12.1, ZFS, atime=on
PS: Yes, I’m aware that -atime 1m isn’t older than one month but younger than one minute. I was testing it