Easy and Simple Solution

Friday, August 12, 2016

install tmpwatch in linux

No comments
Tmpwatch is a application to delete old files on scheduled time.This application will reduce your time on clearing old cache and tmp files.

yum install tmpwatch -y
Once installed tmpwatch run the command to clean the files.
/usr/sbin/tmpwatch -am 4 /tmp
Above command will remove 4 hours old files.
To run this command automatically, add cron using the command
crontab -e
Add the below line 
0 4 * * * /usr/sbin/tmpwatch -am 4 /tmp
Once done restart the cron service.
/etc/init.d/crond restart

No comments :

Post a Comment