On Wed, 2003-07-30 at 12:17, Adam Reynolds wrote:
> Having read the Man page I see that I can use extension in the
> logrotate.conf script but how can I tell it to attach the date to this??
> will the line
>
> extension `date -d '1 day ago' +%d%m%Y`
>
> in the logrotate.conf achieve what I'm after??
All applications that are being logged have a separate configuration
file in /etc/logrotate.d/
You propably can find the logging directives for httpd and samba
services from there, for example. So make changes there - not to
logrotate.conf directly - if you want to affect only one speicific
application's logging.
Correct format for the date command would be:
`date +%d%m%Y --date=\"-1 days\"`
I tried the to use it as extension for logrotate but it did not work.
Actually I can't get it to work at all:
In my /etc/logrotate.d/httpd I had:
/var/log/httpd/*log {
missingok
extension foo
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null
\
|| true
endscript
}
But the directive did not affect my logs at all after
root# logrotate -f /etc/logrotate.conf
The logs just got rotated normally but no foo extension appeared.
Strange.
Well, you could also try
prerotate
cp /logdir/yourlogfile \
/backupdir-`date +%d%m%Y --date=\"-1 days\"`
endscript
at the beginning of /etc/logrotate.d/yourapps. Haven't tried that out,
though.
There is a generic tutorial for logrotate available at
http://www.thenexus.co.uk/support/linux/logrotate.html
If syslog cannot answer to all your needs, you might want to try
something else, for example:
http://www.nongnu.org/rottlog/
Regards,
Peter
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list