Article ID: 117134, created on Sep 5, 2013, last review on May 11, 2014

  • Applies to:
  • H-Sphere 3.6.2

Symptoms

1) Log rotation does not work:

 ll /hsphere/local/home/<user>/logs/<domain>/
total 227M
-rw-r--r-- 1 username username 225M Sep  5 05:32 domain.com  
-rw-r--r-- 1 username username 1.7M Mar 31 02:01 domain.com.1  
-rw-r--r-- 1 username username 132K Mar 31 02:01 domain.com.2.gz  
-rw-r--r-- 1 username username 82K Mar 30 02:00 domain.com.3.gz  
-rw-r--r-- 1 username username 110K Mar 29 02:00 domain.com.4.gz  
-rw-r--r-- 1 username username 145K Mar 28 02:00 domain.com.5.gz  
-rw-r--r-- 1 username username 150K Mar 27 02:00 domain.com.6.gz  
-rw-r--r-- 1 username username 101K Mar 26 02:00 domain.com.7.gz  

Take a look on date of the .*gz files

2) /hsphere/local/config/httpd/logrotate_confs/ folder is empty.

3) /hsphere/local/var/logrotate/logrotate.status corrupted.

Cause

hsphere/local/var/logrotate/logrotate.status corrupted. Bug.

Resolution

Repair corrupted file /hsphere/local/var/logrotate/logrotate.status in your favorite editor (vi, vim)

Recreate all logs by the following commands:

for i in `ls /hsphere/local/home/`; do if [ -d "/hsphere/local/home/$i/logs" ]; then for j in `ls "/hsphere/local/home/$i/logs"`; do echo -e "/hsphere/local/home/$i/logs/$j/$j \\n { \\n rotate 7 \\n daily \\n notifempty \\n create 644 $i $i \\n missingok \\n delaycompress \\n compress \\n }" > "/hsphere/local/config/httpd/logrotate_confs/$j.transferlog.conf" ; done ;  fi; done  

for i in `ls /hsphere/local/home/`; do if [ -d "/hsphere/local/home/$i/logs" ]; then for j in `ls "/hsphere/local/home/$i/logs"`; do echo -e "/hsphere/local/home/$i/logs/$j/agent_log \\n { \\n rotate 7 \\n daily \\n notifempty \\n create 644 $i $i \\n missingok \\n delaycompress \\n compress \\n }" > "/hsphere/local/config/httpd/logrotate_confs/$j.agentlog.conf" ; done ;  fi; done  

for i in `ls /hsphere/local/home/`; do if [ -d "/hsphere/local/home/$i/logs" ]; then for j in `ls "/hsphere/local/home/$i/logs"`; do echo -e "/hsphere/local/home/$i/logs/$j/error_log \\n { \\n rotate 7 \\n daily \\n notifempty \\n create 644 $i $i \\n missingok \\n delaycompress \\n compress \\n }" > "/hsphere/local/config/httpd/logrotate_confs/$j.errorlog.conf" ; done ;  fi; done  

for i in `ls /hsphere/local/home/`; do if [ -d "/hsphere/local/home/$i/logs" ]; then for j in `ls "/hsphere/local/home/$i/logs"`; do echo -e "/hsphere/local/home/$i/logs/$j/referrer_log \\n { \\n rotate 7 \\n daily \\n notifempty \\n create 644 $i $i \\n missingok \\n delaycompress \\n compress \\n }" > "/hsphere/local/config/httpd/logrotate_confs/$j.referrerlog.conf" ; done ;  fi; done  

Then run:

 sudo perl /hsphere/shared/scripts/cron/cron_rotate.pl

e5eac925e853cc7ef3f6055683c98fbb 6311ae17c1ee52b36e68aaf4ad066387 f213b9fa8759d57bee5d547445806fe7 2e39a5e5b1423cc126cf735bac076008

Email subscription for changes to this article
Save as PDF