When you use cache modules such as memcache, xcache, eAccelerator and others on your cpanel server, then the modules would be very wasteful consuming temporary space from your servers.
One way to clear the cache in tmpDSK that are not used within a certain time is to use tmpwatch. Here’s an example of using tmp watch that at the store in the crontab:
1 |
0 * * * * /usr/sbin/tmpwatch --mtime --all 24 /tmp |
Rare-steps are as follows:
1 2 3 4 5 6 7 |
<ul> <li>Login to your server using ssh</li> <li>Type <strong>nano crontab-e</strong></li> <li>Enter <strong>0 * * * * /usr/sbin/tmpwatch --mtime --all 24 /tmp</strong></li> <li>press ctrl + o (to save)</li> <li>press ctrl + x (for exit)</li> </ul> |
Meaning of crontab command above is the server will clear the cache in tmpDSK that are not in use within 24 hours and orders to remove it will be repeated every 1 hour
The question now, whether it is safe for your server? the answer, I do it and never felt there was a problem
hatur nuhun kang Asep.
tapi ini ngehapus semua file di /tmp kang ? mysql.sock sama clamd.sock juga ikut kehapus ga? takutnya ikut kehapus
semua yg di tmp akan di hapus kan, tp ga usah khawatir yg di hapus kan yang udah 24 jam ga di pake, klo ragu tinggal di tambah aja jamnya