As an system administrator I have a lot of log, bak and tmp files. In most situations I want to clean up the oldest files, but retaining te last log files.
So I made a script wich looks at the age and number of files to be retained.
Example:
#include <file.au3>
#include <array.au3>
#include <date.au3>
Delete al files in TempDir with mask ~DF*.TMP minimum 24 hours old, but keeping 7 versions
_FileDeleteByAge(@TempDir, "~DF*.TMP", 24, 7)
UDF:
;====================