I have some issues with log files rotation, /var/log/hspc/*.log files are not rotated, how do I solve this?

Article ID: 2177 
Last Review: Oct,6 2008
Author: Tarasov Yuri
Last updated by: system APPLIES TO:
  • Parallels Business Automation - Standard 3.2.x
  • Parallels Business Automation - Standard 3.3.x

Symptoms

  • /var/log/hspc/*.log files are not rotated
  • there are no enough diskspace inside HSPcomplete VE

Resolution

Please use the following steps to resolve logrotation issue:

  • ensure that there is enough diskspace to rotate /var/log/hspc/*.log files - free diskspace size should be greater than size of every /var/log/hspc/*.log file:
    # ls -1Ssh /var/log/hspc/*.log
    # df -h
    • If there are no enough diskspace please check this article to solve diskspace shortage issue
  • check if crond service is configured to be running in current runlevel and is running:
    # /etc/init.d/crond status
    crond (pid 32193) is running...
    # runlevel
    N 3
    # chkconfig --list crond
    crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    according to the output above crond is running, and enabled for current runlevel (3)
    • In case crond service is stopped please use the following command to start crond:
      # chkconfig crond --levels 2345 on
      # /etc/init.d/crond start
      Starting crond: [ OK ]
  • ensure that `logrotate /etc/logrotate.d/hspc` command is working correctly:

    logrotate configuration for /var/log/hspc/*.log files is stored in /etc/logrotate.d/hspc file, cron is just executing `logrotate /etc/logrotate.d/hspc` to rotate this files, so to reproduce the issue with rotation it is enough to execute the following command:

    # logrotate /etc/logrotate.d/hspc

    • In case command is executed successfully - logrotate is working correctly
    • In case command is failed or hanged - please terminate existing instances of logrotate, execute the following command:
      # mv /var/lib/logrotate.status /var/lib/logrotate.status.old
      and try to perform logrotation once again

     

     

Keywords: logrotate,disk space


Subscription for this article changesSubscription for this article changes

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields