Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 55008 invoked from network); 16 Nov 2006 16:08:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2006 16:08:55 -0000 Received: (qmail 97697 invoked by uid 500); 16 Nov 2006 16:08:58 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 97633 invoked by uid 500); 16 Nov 2006 16:08:58 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 97618 invoked by uid 99); 16 Nov 2006 16:08:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 08:08:57 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [128.103.149.85] (HELO ralph.harvard.edu) (128.103.149.85) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 08:08:43 -0800 Received: from localhost (localhost [127.0.0.1]) by camail.harvard.edu (Postfix) with ESMTP id 7D62D114 for ; Thu, 16 Nov 2006 11:08:22 -0500 (EST) Received: from H008146.harvard.edu (dhcp-19-138.harvard.edu [128.103.19.138]) by camail.harvard.edu (Postfix) with ESMTP id 51999D4 for ; Thu, 16 Nov 2006 11:08:22 -0500 (EST) Message-Id: <5.2.1.1.2.20061116110406.01827b58@camail.harvard.edu> X-Sender: efortin@camail.harvard.edu X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Thu, 16 Nov 2006 11:08:08 -0500 To: "Ant Users List" From: Elaine Fortin Subject: Re: AW: Ant exec find -exec problem In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: amavisd-new at harvard.edu X-Virus-Checked: Checked by ClamAV on apache.org With the attribute of , how do I specify " today less=20 ${requested.days} " ? I don't see any way of doing math functions on dates in Ant. Thanks, Elaine At 01:26 PM 11/16/2006 +0100, you wrote: >In Ant you should not think about what to do with each single file. >Catch all at once. > >Move multiple files with >"select" old files using > > >Jan > > >-----Urspr=FCngliche Nachricht----- > >Von: Peter Reilly [mailto:peter.kitt.reilly@gmail.com] > >Gesendet: Mittwoch, 15. November 2006 22:14 > >An: Ant Users List > >Betreff: Re: Ant exec find -exec problem > > > >three answers: > >1) you do not need to escape the args for find as > > you are not using a shell: > > > > >./feeds_backup;"/> > >2) for is only for ant1.6+ so to avoid confusion with ant1.5 it > > is only defined in the xml task/type definitions of ant-contrib. > > The recommended way to use this is via xml namespaces, drop > > ant-contrib.jar into $ANT_HOME/lib or ~/.ant/lib > > and declare the antlib namespace antlib:net.sf.antcontrib > > > > > > > > > > param is @{p} > > > > > > > > > >3) I normally use the shellscript task from antcontrib: > > > > find ./feeds -name myFilename* -mtime +10 -exec mv '{}' > >./feeds_backup \; > > > > > >Peter > > > >On 11/15/06, Elaine Fortin wrote: > >> This looks very good. I do have antcontrib but I see that the 'for' > >> task isn't operational. It's actually commented out in the > >> antcontrib.properties, as "Tasks Requiring Ant 1.6 or > >higher" and this > >> is Ant 1.6.5 ! Huh? I will uncomment it and see if that > >works. Thanks! > >> > >> At 11:41 AM 11/15/2006 -0800, you wrote: > >> >I have a target in my build.xml that deletes files older > >than 60 days. > >> >Here is how I did it purely in Ant... > >> > > >> > > >> > >> >offset=3D"-60" unit=3D"day"/> > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > Deleting files older than 60 days from the > >archive: > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> >You could easily change this to move files older than 10 days. Note > >> >that this makes use of the task from the ant-contrib project > >> >(http://ant-contrib.sourceforge.net/tasks/tasks/index.html) > >> > > >> >I hope this helps. > >> > > >> >-Rob Anderson > >> > > >> > > -----Original Message----- > >> > > From: Elaine Fortin [mailto:elaine_fortin@harvard.edu] > >> > > Sent: Wednesday, November 15, 2006 11:21 AM > >> > > To: user@ant.apache.org > >> > > Subject: Ant exec find -exec problem > >> > > > >> > > I am trying to create an Ant script to move files that > >are 10 days > >> > > old to a backup directory. > >> > > I cannot find how to do this purely in Ant, but I know that the > >> > > Unix 'find' > >> > > works. > >> > > > >> > > Ant returns the error: "[exec] /bin/find: incomplete statement" > >> > > > >> > > when I issue the following: > >> > > > >> > > >> > > myFilename* -mtime +10 -exec mv '{}' ./feeds_backup \; "/> > >> > > > >> > > > >> > > This command works fine when issued from a Unix shell: > >> > > find ./feeds -name myFilename* -mtime +10 -exec mv '{}' > >> > > ./feeds_backup \; > >> > > > >> > > How can I make this work? > >> > > > >> > > Thanks, > >> > > Elaine > >> > > > >> > > > >> > > > >> > > > >------------------------------------------------------------------ > >> > > --- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For > >> > > additional commands, e-mail: user-help@ant.apache.org > >> > > > >> > > > >> > > > >> > > >> > > >> > >>--------------------------------------------------------------------- > >> >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For > >> >additional commands, e-mail: user-help@ant.apache.org > >> > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For > >additional > >> commands, e-mail: user-help@ant.apache.org > >> > >> > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For > >additional commands, e-mail: user-help@ant.apache.org > > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org