ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Stringer <...@burbong.com>
Subject Re: Multiple directories
Date Thu, 08 Jun 2006 08:48:51 GMT
On Thu, 2006-06-08 at 09:02 +0100, David Bates wrote:
> I have the following target:
> 
>  
> 
>   <target name="backup" description="Backup existing application">
> 
>     <tstamp>
> 
>       <format property="deployment.start" pattern="yyyy-MM-dd_HHmm"/>
> 
>     </tstamp>
> 
>  
> 
>     <zip destfile="${backup.dir}/${deployment.start}.zip">
> 
>       <zipfileset dir="${backup.frontend.dir}" prefix="Frontend Files"/>
> 
>       <zipfileset dir="${backup.backend.dir}" prefix="Backend Files"/> 
> 
>     </zip>
> 
>   </target>
> 
>  
> 
> I run this prior to doing a deployment to ensure we have a backup of
> what was on the server in case everything goes wrong.
> 
>  
> 
> The property "backup.backend.dir" comes from a property file.  The
> problem is that I use this script on several different servers and on
> some servers several directories need to be backed up.  For example, on
> our Live server I need to backup servers/MyApp.  However, on our User
> Acceptance Testing server we have several instances of the application
> and all these need to be backed up: servers/MyApp1, servers/MyApp2,
> servers/MyApp3.
> 
>  
> 
> Is there a neat way of doing this?
> 
>  
> 
>   e.g. backup.backend.dir=servers/MyApp1:servers/MyApp2:servers/MyApp3
> 
>   or backup.backend.dir=servers/MyApp*
> 

I'd suggest in the properties file:

backup.backend.dir=servers

...then in the build.xml...

<zipfileset dir="${backup.backend.dir}/MyApp*" prefix="Backend Files"/>

Cheers, Ben


>  
> 
> Cheers again,
> 
>  
> 
> David.
> 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message