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 Extra patterns that you may want to protect A good solution for periodic cleanup of the tmp directory is the tmpreaper tool.
Űrvilág.hu - Folyik az Ariane–6 fejlesztése
Both /tmp and /var/tmp are directories designed to store temporary files created by the system and the users
Files inside these directories are typically cleared upon reboot or after a certain duration.
Tmpreaper recursively searches for and removes files and empty directories which haven't been accessed for a given number of seconds Normally, it's used to clean up directories which are used for temporary holding space, such as /tmp. It provides a detailed guide on using essential linux commands to clear, archive, and automate the management of log files and temporary directories like `/var/log` and `/tmp`. One effective tool for managing these files is tmpreaper
This article will guide you through the process of installing, configuring, and using tmpreaper to automatically clean up temporary files in linux. Selinux defines the file context types for the tmpreaper, if you wanted to store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk. By default, it leaves a cronjob file under the /etc/cron.daily/tmpreaper directory This cronjob works according to the configuration file located in /etc/timereaper.conf.
By default, tmpwatch/tmpreaper can use access time, inode change time, modification time to remove files
Usually, tmpwatch/tmpreaper is used to remove files from “/tmp” folder and other folders like old log files. Its behaviour can be tuned via the /etc/tmpreaper.conf file This file can contain settings entries to override the defaults in the cron.daily script itself Age of files before they're removed