Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Sasha http://nothing-less.net

« Newer Snippets
Older Snippets »
Showing 11-16 of 16 total

How To Empty /var

If /var is too full:

   1  cd /var
   2  du -sh *


If the log directory is the problem:

   1  rm -f /var/log/*.1
   2  rm -f /var/log/*.2
   3  rm -f /var/log/*.3
   4  rm -f /var/log/*.4


(The /var/log directory contains archived files that always end with a number: exim_mainlog.1. Any file ending with a number can be safely deleted.)

If the problem is with the exim_mainlog being too large, try rotating the logs:

   1  /usr/sbin/logrotate -vf /etc/logrotate.conf


If you get an error about a duplicate log entry:

   1  cd /etc/logrotate.d
   2  rm -rf httpd.rpmorig.log


And try the rotate again.

If the problem is in spool:

   1  cd /var/spool/exim/msglog
   2  rm -rf *

How To Empty /usr

How To Empty /usr

   1  
   2  cd /usr/local/apache/domlogs/
   3  rm -rf *.*
   4  /scripts/restartsrv httpd

How To Empty /backup

If /backup/ is too full:

   1  
   2  cd /backup/cpbackup/monthly/
   3  rm -f *.gz
   4  /scripts/restartsrv httpd


Check the space after this, and it should be fine.

How To Fix Incorrect Disk Space

How To Fix Incorrect Disk Space

   1  
   2  /scripts/fixquotas
   3  /scripts/updatemysqlquota

How To Turn Off/On Stats For One Account

http://forums.cpanel.net/showthread.php?t=15967&highlight=urchin

You can edit the:

   1  pico /var/cpane/users/accountname


file and add settings for the stats packages.

   1  skipanalog=1
   2  skipawstats=1
   3  skipwebalizer=1


That will turn them off and override the server setttings.

To update the stats now:

   1  /scripts/runweblogs username
   2  /scripts/runlogsnow

How To Fix MySQL Error 28

MySQL: 1030: got error 28 from server handler

   1  
   2  cd /tmp
   3  df -i /tmp
   4  df -h /tmp


Delete anything that’s not supposed to be there.
Stop all databases

   1  
   2  /etc/rc.d/init.d/chkservd stop
   3  /etc/rc.d/init.d/mysql stop


Then fix tables:

   1  
   2  cd /var/lib/mysql


Check each letter for errors:

   1  
   2  myisamchk -cs a*/*.MYI


Repair where necessary:

   1  
   2  myisamchk -r a*/*.MYI
   3  myisamchk -r b*/*.MYI
   4  myisamchk -r c*/*.MYI
   5  myisamchk -r d*/*.MYI
   6  myisamchk -r e*/*.MYI
   7  myisamchk -r f*/*.MYI
   8  myisamchk -r g*/*.MYI
   9  myisamchk -r h*/*.MYI
  10  myisamchk -r i*/*.MYI
  11  myisamchk -r j*/*.MYI
  12  myisamchk -r k*/*.MYI
  13  myisamchk -r l*/*.MYI
  14  myisamchk -r m*/*.MYI
  15  myisamchk -r n*/*.MYI
  16  myisamchk -r o*/*.MYI
  17  myisamchk -r p*/*.MYI
  18  myisamchk -r q*/*.MYI
  19  myisamchk -r r*/*.MYI
  20  myisamchk -r s*/*.MYI
  21  myisamchk -r t*/*.MYI
  22  myisamchk -r u*/*.MYI
  23  myisamchk -r v*/*.MYI
  24  myisamchk -r w*/*.MYI
  25  myisamchk -r x*/*.MYI
  26  myisamchk -r y*/*.MYI
  27  myisamchk -r z*/*.MYI


Turn everything back on:

   1  
   2  /etc/rc.d/init.d/chkservd start
   3  /etc/rc.d/init.d/mysql start
« Newer Snippets
Older Snippets »
Showing 11-16 of 16 total