Logrotate Question
Mertens, Bram
mertensb at mazdaeur.com
Tue Jun 17 19:00:21 UTC 2008
Or what about soemthing like (untested)
######################################################################
/opt/netlogs/live/*.log {
daily
prerotate
/bin/mkdir -p "/opt/`date +%Y/%m/%d`"
rm -f /opt/live
ln -s /opt/`date +%Y/%m/%d` /opt/live
endscript
olddir "/opt/live"
sharedscripts
missingok
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null`
2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null`
2> /dev/null || true
endscript
}
########################################################################
#
Regards
Bram
>
Mazda Motor Logistics Europe NV, Blaasveldstraat 162, B-2830 Willebroek
VAT BE 406.024.281, RPR Mechelen, ING 310-0092504-52, IBAN : BE64 3100 0925 0452, SWIFT : BBRUBEBB
-----Original Message-----
> From: redhat-list-bounces at redhat.com
> [mailto:redhat-list-bounces at redhat.com] On Behalf Of Marcos Trazzini
> Sent: vrijdag 13 juni 2008 21:20
> To: General Red Hat Linux discussion list
> Subject: Re: Logrotate Question
>
> (...)
> > Thanks, but it got the same error.
> >
> OK, let's try some other approach, as olddir option seems to bypass
> parsing some shell commands. I believe that the following example
> should work, and with some small modifications can turn you log
> rotator much more flexible:
>
> ---- CUT HERE ----
>
> /tmp/*.log {
> daily
> postrotate
> BASEDIR="/opt/netlogs/live"
> DEST="/opt/`date +%Y/%m/%d`"
> /bin/mkdir -p $DEST
> /usr/bin/find $BASEDIR -type f -name
> '*.log.1' -exec mv {} $DEST/ \;
> endscript
> sharedscripts
> missingok
> }
>
> ---- CUT HERE ----
>
> Rgds
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >> --
> >> redhat-list mailing list
> >> unsubscribe
> mailto:redhat-list-request at redhat.com?subject=unsubscribe
> >> https://www.redhat.com/mailman/listinfo/redhat-list
> >
> > --
> > redhat-list mailing list
> > unsubscribe
> mailto:redhat-list-request at redhat.com?subject=unsubscribe
> > https://www.redhat.com/mailman/listinfo/redhat-list
> >
>
>
>
> --
> Marcos S. Trazzini => mstrazzini at gmail.com
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>
More information about the redhat-list
mailing list