≡ Menu

Clean tmpDSK with tmpwatch

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:

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

Rare-steps are as follows:

  • Login to your server using ssh
  • Type nano crontab-e
  • Enter 0 * * * * /usr/sbin/tmpwatch --mtime --all 24 /tmp
  • press ctrl + o (to save)
  • press ctrl + x (for exit)

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

{ 2 comments… add one }
  • egi May 22, 2011, 2:45 pm

    hatur nuhun kang Asep.
    tapi ini ngehapus semua file di /tmp kang ? mysql.sock sama clamd.sock juga ikut kehapus ga? takutnya ikut kehapus

    • Kang Asep June 1, 2011, 11:58 pm

      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

Leave a Comment

CAPTCHA
*