# Monthly configuration file for GNU Rot[t]Log
#
#
# This is a sample configuration file. Fit to your needs.


/var/adm/log.daemon,/var/adm/log.debug {
	# These actions will be performed after archived each logfile
	postrotate
	    /sbin/killall -HUP syslogd
	endscript
	# Don't compress yet logfile (see README)
	delaycompress
	# Let in newlogfile events logged from first day of actual month
	logpart "#1 day"
}

/var/adm/messages {
        # Store compressed messages in $packdir/messages
	storedir messages
	# These actions will be performed before archive logfile
	prerotate
 	   /sbin/killall -STOP myprogram
	endscript
	# Rotate logs with extensions from .1 to .5
        rotate 5
        # Don't rotate log if it's empty
	notifempty
}

/var/adm/wtmp,/var/adm/lastlog {
	# To create a new log file with perms, own and group specified
	create 644 root root
	# Don't compress yet logfile (see README)
	delaycompress
	# Send notification e-mail message to a different user from 
	# global touser
	touser "admin@example.net"
}

# Following definitions will be used for all logfiles stored in /var/log
# dir and beginning by 'log.a'
/var/log/log.a* {

     # Descend two levels of depth to find files respecting criteria
     # (beginning by log.a)
     maxdepth 2

     # Use of meta-variables. storedir will be expanded for each processed 
     # file (so i.e. will be used 2002/04/log.auth, 2002/04/log.apache, ....)
     # to store compressed archived logs
     storedir @YEAR/@MONTH/@BASENAME

     # Make new dirs if necessary with specified permissions, owner and group
     # ALERT: See README for more details.
     createdir 0640 root loggers
  
     # Rotate files with a 6 month period.
     rotate 6

     # Flag to use only with an ext2 filesystem. Add append-only attribute
     # to logfile
     append-only

     # Don't rotate if logfile is smaller than 1 Megabyte
     size 1M
}

# Following definitions will be used for all logfiles stored in 
# local /usr/local/apache/logs dir. Archived files will be stored
# in a remote volume, mounted with nfs.
/usr/local/apache/logs/* {
  # Action between firstaction and endaction tags will be performed before
  # all logfiles are rotated/archived
  firstaction
    mount fserver.local.net:/LogArchive /mnt/LogVol
  endaction

  # Define a storedir available only after firstaction is performed
  storedir /mnt/LogVol/@YEAR/@MONTH/@BASENAME

  # See previous examples for more informations about two following
  # commands
  createdir 0640 root loggers
  notifempty

  # After each log file is rotated following commands will be executed 
  postrotate
    /usr/local/apache/bin/apachectl restart
    /usr/local/bin/my-nice-script.sh
  endscript

  # Action between lastaction and endaction tags will be performed after
  # all logfiles has been rotated/archived
  lastaction
    umount /mnt/LogVol
  endaction
}

# Following definitions will be used for all logfiles stored in
# local /usr/local/squid/logs/ dir. Archived files will be appended
# onto a tape. 

/usr/local/squid/logs/* {
  # Action between firstaction and endaction tags will be performed before
  # all logfiles are rotated/archived
  firstaction
    mt -f /dev/nst0 eom
  endaction

  # Define a temporary storedir
  storedir @TMPDIR

  notifempty

  # After each log file is rotated following commands will be executed
  postrotate
    star -cv -f /dev/nst0 @TMPDIR/@FILENAME
  endscript

  # Action between lastaction and endaction tags will be performed after
  # all logfiles has been rotated/archived
  lastaction
    mt -f /dev/nst0 offline
  endaction
}


