I think you have to sort on the %d AND %i . Actually you have to parse the %d{...} part of the file name according to the configured pattern which results a datetime. Then you have to sort the files based on datetime + %i. Then delete as much as neccessary starting with the oldest. |