1

I have following ant target to create an archive of log files.

It collects all log files from the .metadata directory of an eclipse workspace recursively and log files from the project directories non-recursively.

I would like to delete the files after they have been archived. How can I achieve this? I cannot use fileset as I need the extra attributes of the tarfileset.

<target name="tar_logfiles">
    <tar destfile="logs.tgz" compression="gzip">
         <tarfileset dir=".metadata" preserveLeadingSlashes="true" prefix=".metadata">
                <include name="**/.log*" />
                <include name="**/*.log" />
         </tarfileset>
    <tarfileset dir="${basedir}" preserveLeadingSlashes="true">
        <include name="*/.log" />
    </tarfileset>
    </tar>
</target>
kenorb
  • 155,785
  • 88
  • 678
  • 743
carl verbiest
  • 1,113
  • 1
  • 15
  • 30

0 Answers0