I have readout the above url for tmwatch but cannot understand how to set out it to clean in every 12 hours. So can you please give me step by step instructions that how can I set tmpwatch to clear it in every 12 hours.Hello,
I thinks you need to use tmpwatch.
Definition: tmpwatch: The tmpwatch utility recursively searches through specified directories and removes files which have not been accessed in a specified period of time. Tmpwatch is normally used to clean up directories which are used for temporarily holding files (for example, /tmp). Tmpwatch ignores symlinks, won't switch filesystems and only removes empty directories and regular files.
Please use the URL for cron details : /http://prefetch.net/blog/index.php/2009/05/01/automating-temporary-file-cleanup-with-tmpwatch/
0 */4 * * * /usr/sbin/tmpwatch -am 12 /tmp
You can browse to the /tmp directory via the command line, and use the following commands to determine which files are using the most disk space:I have set that cron but still /tmp get full some times. So how can I determine what actually is the problem? Why tmp is getting full?
# cd /tmp
# du -sh * .[a-zA-Z]*
tmpdir=/mysqltmp
mkdir /mysqltmp
chown -R mysql:mysql /mysqltmp
/etc/init.d/mysql restart
mysqladmin var | grep tmpdir