ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viraj Purang <>
Subject FW: Rotating log files
Date Sun, 08 Jul 2001 02:45:19 GMT
Hi Ingmar,
   Can youi send me the text of your cron job ?
  I too have a cron job   but I just run ant with the basic verbose and
logfile options ...
WOuld like to see how ..others have implemented theirs ?
Can you pass it on ?
Viraj Purang

-----Original Message-----
From: Ingmar Stein []
Sent: Friday, July 06, 2001 6:51 AM
Subject: Re: Rotating log files

> Create an "excludesfile" to specify to <zip> that contains that latest 10
> files. How you do that is up to you, depending on how portable you need it
> to be. Eg, if your logs are on a Unix box, you could do something as
> simple as <exec> a 'sh' that runs (in the log-file directory):
> ls -lt | grep -v -e "^d" -e "^total" | head | awk '{print $NF;}' > ex.logs

Yeah, this is what I though of, too.
I just wanted to know if that's possible with stock Ant. Obviously not.

> If you need more portability, and you know Java, you could write a task to
> do it (should be pretty straightforward to do). Or write a perl script,
> etc.

I think I'm going to add a "datefilter" element to the <fileset> where you
specify a date or a timespan and a comparison function (one of "before",
"equals" and "after").
I'll post it to the ant-user list, if anyone wants this functionality, too.


View raw message