Log files

  1. /etc/syslog.conf defines the system logging directories. Relocate them into /var
     
                            # HP-UX 9.x 
    mail.debug              /var/spool/mqueue/syslog 
    *.info,mail.none        /var/adm/syslog 
                            # HP-UX 10.20, 11.0 
    mail.debug              /var/adm/syslog/mail.log 
    *.info;mail.none        /var/adm/syslog/syslog.log 
     
    
  2. logrotate.sh is a local admin shell script
    to rename previous versions of the above logfiles by appending a version number running from 0 through 5. This way the last week's syslogs are kept. Use
     
    crontab -e  # HP-UX >= 10                     
    
    or:
     
    vi /usr/spool/cron/crontabs/root   # HP-UX < 10 
    
    to enter:
    # HP-UX < 10 
    2 3 * * * /opt/bin/logrotate.sh /var/spool/mqueue/syslog
    4 3 * * * /opt/bin/logrotate.sh /var/adm/syslog
    # HP-UX >= 10 
    2 3 * * * /opt/bin/logrotate.sh /var/adm/syslog/mail.log
    4 3 * * * /opt/bin/logrotate.sh /var/adm/syslog/syslog.log
    
    which will schedule log rotation at 3 AM plus 2 and 4 minutes, respectively.

Last update: 21-Feb-2010, M.Kraemer