logfile name different each day
Francis J. Lacoste
flacoste at logreport.org
Fri Sep 16 15:57:12 CEST 2005
On September 16, 2005 07:40, Mikael Kermorgant wrote:
> Hello,
>
> I have setup a syslog-ng server (debian sarge) which creates one file a
> day. It's an easy way to archive logs as they are put in a directory like
>
> /logs/2005/09/15/syslog-2005-09-15.log
>
> However, how can I configure lire to read the good file each day when I
> actually have a line like this in my config file :
>
> logfile=/var/log/messages.0
>
> I use lire version 2.0.1-4
If you use the lire(1) command to configure your cron job. The log file
parameter in ImportJobs interpolates strftime(3) substitution characters.
In your case you would specify the log file as:
/logs/%Y/%m/%d/syslog-%Y-%m-%d.log
You could probably do the same thing in the lr_vendor_cron config by
interpolating the date command:
logfile=`date --date yesterday +/logs/%Y/%m/%d/syslog-%Y-%m-%d.log`
Francis J. Lacoste
--
Francis J. Lacoste . . http://www.logreport.org
/^LogReport$/ . . flacoste at logreport.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.logreport.org/pipermail/questions/attachments/20050916/1df351bd/attachment.bin
More information about the Questions
mailing list