You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Bates <da...@triggersoft.com> on 2006/06/08 10:02:13 UTC
Multiple directories
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*
Cheers again,
David.
Re: Multiple directories
Posted by Ben Stringer <be...@burbong.com>.
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