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.