How to clear /tmp on Centos/cPanel server Print

  • 0

First wee need to install tmpwatch.

yum install tmpwatch -y

once tmpwatch is installed run following command-

/usr/sbin/tmpwatch --mtime --all 24 /tmp

You can change 24 to 1 hour also.

 

This will delete all files over 24 hours old. We can configure cronjob to automated this process.

from SSH type:

crontab -e

Go to the very bottom and paste

cron

then press Control+X you will get confirmation do you want to save. Type Y for yes, and press enter.

 

Was this answer helpful?

« Back