How to clear /tmp on Centos/cPanel server

 If your /tmp is too small, then you will face /tmp full issue. cPanel by default create /tmp with 512mb space. For shared hosting server domain reseller program 512mb is too small. However, we will teach you “how to increate /tmp size” on our next tutorial.


If you face /tmp full issue, you can clear your tmp using tmpwatch. Also you can remove session file.


First wee need to install tmpwatch.


yum install tmpwatch -y


once tmpwatch is installed run following command-


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


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.


Also we can delete session file using following command.


# cd /tmp

# rm -rf sess_*

Visit more

Comments

Popular posts from this blog

Restart DNS Client Service Windows 10: Step By Step Guide

Comprehensive Guide to Domain Hosting Services in Pickering

Advance Server Bangladesh