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


Cheers,

Ingmar Stein

Reply via email to