scripts for rotation and compression of sys logs

As a UNIX newbie, how can I create a (cron)script that rotates my syslogs on AIX 4.3.3 on a 24 hour basis and compresses the old logs ?

TIA !

You can do this :

Input this command into root cron :

30 23 * * * /rotate_syslog

This command execute the rotate_syslog at 23:30 o�clock everyday.

Script /rotate_syslog example :

#! /bin/sh
#
LOG=your_syslog
cd /syslog_path
test -f $LOG.3 && mv $LOG.2 $LOG.4
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cat /dev/null > $LOG
chmod 644 $LOG

Witt