ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ingmar Stein" <>
Subject Re: Rotating log files
Date Mon, 09 Jul 2001 08:20:34 GMT
> I tried to do something like this a while back and wasn't successfull with
> straight Ant tasks.  I had to call a script that did what I wanted.  Or
> could embed a script with the <script> task.

Okay, because my build script is executed on each workday, I was able to
do that with straight Ant tasks.

This target does not use an exclude list to archive all but the last 7,
instead it
zips the log files from last week and deletes them.

  <target name="archive">
   <format property="last7" pattern="yyyyMMdd" offset="-7" unit="day"/>
  <zip zipfile="${path.logs}/${last7}.zip" basedir="${path.logs}"
includes="${last7}/**" compress="true"/>
  <delete dir="${path.logs}/${last7}" quiet="true"/>


Ingmar Stein

View raw message