ABHIONLINUX
Site useful for linux administration and web hosting

Showing posts with label tmpwatch. Show all posts
Showing posts with label tmpwatch. Show all posts

2009/11/24

How to set quota on /tmp/eaccelerator

You may have tmpwatch on your system. The cron for that is run daily:

vi /etc/cron.daily/tmpwatch

In there, you can set the max amount of hours for keeping an old file. Lowering this, will clear out all your old cache files.

Another way, is to run a command like below in the tmp folder:

find eaccelerator -mtime +30 -exec rm {} \;

It will clear out any eacceletator files older than 30 days. Use that command carefully though

---------------------------------

Then write yourself a script and run it hourly from cron.

#!shell
#
check disk usage of directory
if (usage > a number)
delete files
fi
------------------------------
tmpwatch --mtime --all 336 /tmp/eaccelerator