ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Forrester, Tom" <>
Subject Tar file won't extract properly within Telnet task
Date Tue, 30 Apr 2002 09:21:38 GMT

On windows I am using the <tar> and <gzip> tasks to archive my Web site.
I then use the <ftp> task to transfer the website.tar.gz file to a remote
Unix server.
I then use the <telnet> task to logon on to the Unix server and after change
to root etc. I unzip the file using gunzip website.tar.gz (within <telnet>),
the I use tar xvf ${remote_stage_dir}/website.tar (still within the <telnet>

The problem is that the result or the tar xvf command unpacks all the files
within the subfolders of the archive, but not the top level files.
If go to the Unix server directly and use the same tar command on the same
file it unpacks all the files correctly, so the ant script is capturing all
the files in the <tar> task.

I also followed the same steps manually by using the telnet program on
windows, and that unpacked the files correctly.

I can only surmise that the <telnet> task in ant is having some effect on
the  tar xvf ${remote_stage_dir}/website.tar command. BTW,
${remote_stage_dir}/ expands properly.

If anyone has any ideas please, reply!

Below is my code:
    <target name="packageWebsite" if="website"
                                description=" creates the website gzip

        <!-- Create a TAR file of the web site-->
        <tar tarfile="${dist}/website.tar" basedir="${web_site}"
MP*" />

        <!-- Archive the TAR file to a GZIP file -->
        <gzip zipfile="${dist}/website.tar.gz" src="${dist}/website.tar"/>

        <target name="deployWebsite" depends="packageWebsite"
                                description="Deploys the web site">
             <!-- FTP the web site to the remote server-->
            <ftp server="${remote_server_domain_map}"
                <fileset dir="${dist}">
                    <include name="**/website.tar.gz"/>
            <!-- Deploy the web site on the remote server-->
            <telnet server="${remote_server_domain_map}">
                <write string="${remote_userid}" />
                <write string="${remote_password}" />
                <read string="${remote_user_home}"/>
                <read string="${remote_user_home}"/>
                <write string="cd ${remote_stage_dir}" />
                <read string="${remote_stage_dir}"/>
                <write string="gunzip website.tar.gz" />
                <read string="${remote_stage_dir}"/>
                <!--<write string="chmod 666 ${virtual_server_path}" />
                <read string="${remote_stage_dir}"/>
                <write string="cd ${virtual_server_path}" />
                <read string="${virtual_server_path}"/>-->
                <write string="tar xvf ${remote_stage_dir}/website.tar" />

Thales Defence Information Systems DISCLAIMER: The information in this
message is confidential and may be legally privileged. It is intended solely
for the addressee.  Access to this message by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying, or
distribution of the message, or any action or omission taken by you in
reliance on it, is prohibited and may be unlawful.  Please immediately
contact the sender if you have received this message in error. Thank you.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message