I’ve found the /tmp folder on one of my servers has over 5.2G of data in it with files dating back about 2 years. I’ve been searching for ways to clean this and on serverfault I found this:
On CentOS, there’s a job in /etc/cron.daily called tmpwatch. This runs /usr/sbin/tmpwatch, which will delete files that haven’t been accessed in the specified number of hours, i.e., the default behavior is to examine the atime for the file to evaluate if it’s been used recently.
Does Virtualmin not set this up/remove this as I can’t see this in my crons, or should there be something else on the server taking care of this?
Operating system CentOS Linux 6.8
Webmin version 1.801
Virtualmin version 5.03
Kernel and CPU Linux 2.6.32-642.1.1.el6.x86_64 on x86_64
Processor information Intel® Xeon® CPU E5-2670 0 @ 2.60GHz, 2 cores
The /tmp/ usage has jumped up overnight as I reported above usage was 5.1G and now this morning 11G.
Running the du -h --max-depth=1 / command for /tmp I get:
Are there some Webmin or Virtualmin backups that are running, which aren’t completing properly? Any errors or so showing up in those backups?
However, since those files exist in Webmin’s temp directory, you can setup Webmin to remove older files. To do that, go into Webmin -> Webmin -> Webmin Configuration -> Advanced, and there, you can set “Maximum age of temporary files”. If it’s already set, you may want to try making it smaller.
No its odd there are no backup logs and I can see the file backed up on Amazon S3 so appears to have actually completed OK. I’ll try reducing the days in the setting in Webmin advanced configuration however would be good to work out why the tmp backups are not being removed?
Also still interested knowing how to purge the overall /tmp/ directory, can you give any help/guidance on this generally i.e. how to acheive this?