--- Ingmar Stein <[EMAIL PROTECTED]> wrote:
> I use Ant for a nightly build system which creates a new directory each
> time it is run via a cron job using
> 
>   <tstamp/>
>   <property name="path.dlogs" value="${path.logs}/${DSTAMP}"/>
>   <mkdir dir="${path.dlogs}"/>
> 
> Now, I wanted to archive all log directories except the latest, say 10,
> entries into a ZIP archive.
> Does anyone know if this is possible with Ant?

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

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.

Diane

=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to