According to the documentation for max_days
here, if the timestamp in a file is older than the max_days
, the file gets deleted.
On the other hand, the documentation here states that if the file is older than max_days
, the file gets rotated. This is what I’m observing in my case. The files are not deleted after the max_days
period, and unrotated files get rotated once they’re max_days
old.
Is there a way to delete rotated files after a set period of time?
I am not familiar with the application you are trying to configure, but if you are on Linux, then I suggest you type man find
and look at the -mtime +days
and -exec command {} ;
options. With the -mtime
option, you can find files that have not been modified for (at least) the specified number of days, and the -exec
option will execute a shell command for the specified file. In your case, I suggest you start with -exec ls -l {} ;
to verify that find
is locating suitably old files, and then migrate to using -exec rm -f {} ;
to delete those old files.
You can put the find
command into a shell script and arrange for that to be executed, say, once per day. man cron
might help you with that.