3

I am talking about the .Trash-1000 folders like.

Some times it's contents size reach like 18GB, and applications trying to write files will fail with no clear messages, because the disk space has ended.

I am looking for a way to force a trash quota/limit with some extra constraints.

These constraints options would be good:

  • by file date/time, older files are erased first.
  • by available disk space, if it has like less than 1GB, no matter what trash file datetime it is, it gets erased to keep 1GB available.
  • by file size, if trashed file is bigger than 500MB, it is promptly erased.

Is there such software sitting somewhere so I can avoid scripting it up?

A.B.
  • 92,125

1 Answers1

2

Try autotrash from the repositories.

autotrash — program to automatically purge old files from the FreeDesk-top.org trash

Once installed, you'll need to add a cron job to run autotrash.
Run crontab -e, and add the following line:

@hourly /usr/bin/autotrash --keep-free 1024 -d 30

I don't think it covers the last point, but it's something to start with.

PS: Also check out man autotrash for more info.

mikewhatever
  • 33,013