autotrash
autotrash copied to clipboard
Don't Delete Files Younger Than a Certain Age
Hello!
When the hard-disk runs out of space completely, --min-free would empty the trash completely – including files the user deleted just half an hour ago.
However, when the drive runs full, there probably is something wrong and the deletion of very young files in the trash could turn out as unnecessary after the problem is fixed. So, in my opinion, it would be nice to add an option to safe files from deletion until they reach a certain age. For example:
autotrash --min-free 2048 --min-days 7
would delete all files until either 2048 MB are free or only files deleted within the last seven days are left.
What do you think?
I have never had this problem myself and I often notice the HD limit problem before cron gets to running autotrash.
But there is no reason not to add this feature. Have you tried patching the code yourself? I'd be happy to review a pull request.