Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to install and use tmpreaper

📅 2017-Nov-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cron, tmp, tmpreaper ⬩ 📚 Archive

The files and directories in the tmp directory are cleaned only during a reboot. This can be problematic if you have applications that write a lot to the tmp directory and you do not want to reboot your Linux system. A good solution for periodic cleanup of the tmp directory is the tmpreaper tool.

$ sudo apt install tmpreaper
$ tmpreaper 2d /tmp

Note that you might need to run that command as sudo to be able to delete files created by other users.

$ tmpreaper --test 2d /tmp

Tried with: tmpreaper 1.6.13 and Ubuntu 16.04