These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Clean /tmp/ on the new forum.
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?
Howdy,
Virtualmin doesn't setup, or remove, tmpwatch... that's something that's done by various distributions out there though.
What distro/version is it that you're using?
-Eric
Hi,
Sorry here you go...
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(R) Xeon(R) 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:
60K /tmp/.virtualmin-10054 9.7G /tmp/.webmin 68K /tmp/pear 4.0K /tmp/.ICE-unix 36K /tmp/hsperfdata_root 11G /tmp
and then again for /tmp/.webmin/ I get:
4.9G /tmp/.webmin/6787- 4.0K /tmp/.webmin/19310- 4.9G /tmp/.webmin/27796- 9.7G /tmp/.webmin/
Do you know what is causing this and if these files/folders can be safely deleted?
Howdy,
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.
-Eric
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?