1

I discovered this post How can I set up Ubuntu 16.04 LTS to automatically empty the trash based on parameters?

Does autotrash itself runs automatically?

If not, how to config it?

0

2 Answers 2

2

You can do it in the old fashion way with Terminal,

$ sudo crontab -e

Add these lines in the Crontab,

@reboot find /home/yourname/.local/share/Trash/expunged/ -type f -mtime +30 -exec rm {} \;

@reboot find /home/yourname/.local/share/Trash/files/ -type f -mtime +30 -exec rm {} \;

@reboot find /home/yourname/.local/share/Trash/info/ -type f -mtime +30 -exec rm {} \;

The -mtime is set to 30 days. The commands above will check and delete files that over 30 days old at system startup. Hope this will help.

1

Looking at the project sources and README.md up on Github, you'll read that in order to run this Python script regularly, you can either:

  • Create a crontab entry with some regular interval (e.g., @daily /usr/bin/autotrash -d 30)
  • Add it to the Startup Application program so autotrash can run every time you boot your system.

For additional configuration details, refer to the Ubuntu Manpage for autotrash.

1
  • 1
    To install autotrash if you already have Python and Pip installed, simply run pip3 install --user autotrash. If your path includes $HOME/.local/bin you can run it directly from the terminal
    – Moritz
    Dec 6, 2021 at 10:23

Not the answer you're looking for? Browse other questions tagged .