Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6957465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:00:24+00:00 2026-05-27T15:00:24+00:00

I’m having issues with sshsession Ant task. I’m writing a deploy script which bzip

  • 0

I’m having issues with sshsession Ant task.

I’m writing a deploy script which bzip sources, scp the archive to a remote server and then unzip sources on the remote server and copy files in the right directory tree.

(...)

<bzip2 src="/tmp/${selected.target}.tar" destfile="/tmp/${selected.target}.tar.bz2"/>
<scp file="/tmp/${selected.target}.tar.bz2" todir="user@server:/tmp/" keyfile="${user.home}/.ssh/id_rsa" trust="yes" passphrase="thisisasecret"/>

<sshsession host="server" username="user" keyfile="${user.home}/.ssh/id_rsa" trust="yes">
    <sequential>
        <untar src="/tmp/${selected.target}.tar.bz2" dest="/tmp/prova_untar" compression="bzip2"/>
        (copy files)
    </sequential>
</sshsession>

(...)

My problem is with tasks specified inside the sshsession, since they are executed locally and not on the remote server. I thought (but clearly i’m wrong) that command specified within sshsession tag would be executed on the server i just connected to. I read in the documentation that you can specify tunnels with localtunnel and remotetunnel, but i’m not sure i’m understanding correctly what those tunnels are for. Does anyone has encountered the same problem, or has a solution for that? The Ant version i’m working with is 1.8.2.
Thanks,

Alberto

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:00:24+00:00Added an answer on May 27, 2026 at 3:00 pm

    I add a answer to show how we use the remote-build.xml.

    For example, we want to deploy some pre-built SQL files to the database server, insert the sql files into a database in MySQL and restart mysql.

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="remote-build" basedir=".">
    
        <target name="run">
            <antcall target="extract" />
            <antcall target="build-database" />
            <antcall target="restart-mysql" />
        </target>
    
        <target name="extract">
            <unzip src="sample-sql.zip" dest="."/>
        </target>
    
        <target name="build-database">
            <taskdef name="insert" classname="my.company.ant.ParallelInsertSQL" classpath="my-company-lib.jar"/>
            <insert dbName="${database.name}" masterSQLs="${basedir}/sample-sql.sql" sqlDir="${basedir}/tables"/>
            <antcall target="restart-database"/>
        </target>
    
        <target name="restart-database">
            <exec executable="bash" inputstring="echo '${database.password}' | sudo -S /etc/init.d/mysql restart"/>
        </target>
    
    </project>
    

    So when deploying, we packed the sql file archive (sample-sql.zip) together with “my-company-lib.jar” and “remote-build.xml” and then transfer the archive file with scp.
    Then, sshexec “ant -f remote-build.xml run” (you can either put the properties in a properties file or transfer them in the sshexec commandline).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am writing an app with both english and french support. The app requests
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.