Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
Subject: application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
Subject: X Windows problem (xauth)
Subject: Upgrading openoffice 1 1 rpm
Subject: FTP: connection refused
Subject: FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
Subject: broadcom network interface
make mrproper
Couldn 't open PID file /var/run/named/named pid Permission denied
sendmail configuration on redhat
kernel 2 6 and /dev/sound/mixer not found
Subject: Promise 378 controller
Subject: Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
Subject: Lotus Notes under Wine
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
/etc/security/limits conf question
Intel E/1000 driver
rpm database corrupt
Command stream end of file while reading
qla2300 modules
 
Logrotate scripts --- trying to manage the rotated daily files

Logrotate scripts --- trying to manage the rotated daily files

2004-01-14       - By Laura Noe

 Back
I have downloaded logrotate to manage the system logs for many remote systems;
therefore, I have created seperate files for each server and placed them in the
/etc/logrotate.d as per man pages.

The following is a sample config of what I have done so far.  All of the
servers are configured very similar since this is the first stages of
configuring a dedicated syslog-ng server.

/etc/logrotate.conf

# !/bin/bash
#
# Global Setting to compress log files after rotation
# and to create new (empty) log files after rotating old ones
#
daily
rotate 7
missingok
create
#
#   RPM packages drop log rotation information into this directory
include /etc/logrotate.d
#



/etc/logrotate.d/servername

!/bin/bash
# Servername Log Rotation
#
/var/log/servername/servername.log {
       prerotate
       /bin/cp -f /var/log/servername/servername.log /var/log/servername
/servername.log.`date +%b%d%y`
       endscript
       olddir /var/log/servername/servername.old
       }


My goal is to rotate the logs every day, rename the log to reflect the date,
then after 7 days, place them in the servername.old directory.  This is not
working, but there is no errors running the cron jobs and no errors reflected
in root's mail.  Also, each time that syslog-ng service is stopped and started,
the log is renamed to servername.log.1 or servername.log.2 and so on so forth
which is not my ultimate solution.

Can anyone lend some advise to reach what I am wanting to achieve in
minipulating the rotation of my system logfiles?






Sincerely,

Laura Noe