The Apache log files tend to fill up disk space. We clean these up every month or so by moving them to a different partition. The other partition is not backed up. We are saving these so we can do security and usage analyses.

Here's what to do next time this happens:

  1. log on to the machine with the full disk, which is likely to be andrews, become root
  2. do
       cd /usr
       du -dk . >& du.out
    
  3. Come back awhile later, do
       sort -nr du.out | head -40
    
  4. Probably local/apache-N.M/logs/200Y/MM is taking up lots of space. So, we move it:
        cd /usr/local/apache/logs/2007
        mv 10 /export/home1/root/apache/logs/2007
        ln -s /export/home1/root/apache/logs/2007/10 .
    
More actions to take to clean up /export/home1 on andrews:
  1. Compress the agent logs. Apparently when the apache logs are moved for the previous month, the last few days of agent log files are not compressed, so we compress them:
         /usr/bin/find /export/home1/root/apache logs/`date +%Y` -mtime +2 -name agent_log -size +1000000c -print > /tmp/agent_logs 
         /usr/local/adm/compress_agent_log `cat /tmp/agent_logs`
    
  2. Gzip the apache logs:
         cd /export/home1/root/apache/logs/2010
         gzip -9 */*/*log* 
    
  3. Stop the web server and rotate /export/home/tmp/php.err:
         /etc/init.d/gsrc stop
         mv /export/home1/tmp/php.err /export/home1/tmp/php.err.4
         /etc/init.d/gsrc start