Recently I noticed that my /tmp folder is messy. There are so many files and directories that are no longer needed.
I am afraid to remove them by hand, so instead I ask my system to do it by itself automatically.
Here are the steps I took to set my system to clean up the temp files automatically :
- Start the YaST Control Center
- Select System
- Select /etc/sysconfig Editor
- In the left pane, go to System, Cron
- Expand the Cron menu by clicking on the “+” symbol
- And change the following field according to my preferences :
- CLEAR_TMP_DIRS_AT_BOOTUP : yes (default :no)
- TMP_DIRS_TO_CLEAR : /tmp (default : /tmp)
- MAX_DAYS_IN_TMP : 2 (default : 0)
- LONG_TMP_DIRS_TO_CLEAR : /var/tmp (default:)
- MAX_DAYS_IN_LONG_TMP : 30 (default: 0)
- After I am done, I click “Finish“.
- Reboot the machine to know the effect.
Here is the editor screenshot :
Now my /tmp folder is not messy anymore. :D