You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rez <po...@hotmail.com> on 2008/11/25 21:22:43 UTC

SCP and SSHExec tasks

Hi
 
Is it possible to create the directories on the remote server on the fly as the scp ant task is executed or do I need to run sshexec to create them first?
 
Thanks

_________________________________________________________________
Windows Live Hotmail now works up to 70% faster.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008

Re: SCP and SSHExec tasks

Posted by David Crossley <cr...@apache.org>.
Rez wrote:
> 
> Is it possible to create the directories on the remote server on the fly as the scp ant task is executed or do I need to run sshexec to create them first?

At Apache Forrest our "forrestbot" can deploy using
the Ant scp task.

It does certainly successfully create new remote directories.

We did have an issue in the past, noting that it
did work with some sshd servers.
http://issues.apache.org/jira/browse/FOR-819

Our issue links to this, where the "JSch" dev
provided a patch to Ant applied by Stefan.
"
 http://marc.theaimsgroup.com/?l=ant-dev&m=110363841323245
 Subject: Re: SCP Task - Problems with directories
 From: Stefan Bodewig <bodewig () apache ! org>
 Date: 2004-12-21
"

I just now verified that all is okay using the server
against which i reported our original issue.

Of course, the other solutions discussed yesterday
are better, but 'scp' does work.

-David

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


RE: SCP and SSHExec tasks

Posted by Rez <po...@hotmail.com>.
Thanks everyone.> Date: Wed, 26 Nov 2008 11:16:00 -0800> From: riznob@gmail.com> To: user@ant.apache.org> Subject: Re: SCP and SSHExec tasks> > The scp task will not create remote directories. Also, there is no recursive> option. Yes, you can specify a fileset, but the directory structure will not> be preserved (as far as I know). If you are moving a bunch of files and want> to preserve the directory structure, the best thing to do is...> > 1. zip or tar.gz the files locally> 2. scp the archive to the remote machine> 3. sshexec to remote machine and unpack the archive> > -Rob Anderson> > On Wed, Nov 26, 2008 at 3:36 AM, Steve Loughran <st...@apache.org> wrote:> > > Rez wrote:> >> >> Hi> >> Is it possible to create the directories on the remote server on the fly> >> as the scp ant task is executed or do I need to run sshexec to create them> >> first?> >>> >>> >> > I use sshexec first, with a mkdir -p as the command. I also have a couple> > of presetdef definitions to simplify making commands> >> > <presetdef name="rpmssh">> > <sshexec host="${rpm.ssh.server}"> > username="${rpm.ssh.user}"> > passphrase="${rpm.ssh.passphrase}"> > trust="${rpm.ssh.trust}"> > keyfile="${rpm.ssh.keyfile}"> > timeout="${ssh.command.timeout}"> > />> > </presetdef>> > <presetdef name="rootssh">> > <rpmssh> > username="root"> > timeout="${ssh.rpm.command.timeout}"> > />> > </presetdef>> >> > ---------------------------------------------------------------------> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org> > For additional commands, e-mail: user-help@ant.apache.org> >> >> > > -- > Rob Anderson> riznob@gmail.com
_________________________________________________________________
Proud to be a PC? Show the world. Download the “I’m a PC” Messenger themepack now.
hthttp://clk.atdmt.com/MRT/go/119642558/direct/01/

Re: SCP and SSHExec tasks

Posted by Robert Anderson <ri...@gmail.com>.
The scp task will not create remote directories. Also, there is no recursive
option. Yes, you can specify a fileset, but the directory structure will not
be preserved (as far as I know). If you are moving a bunch of files and want
to preserve the directory structure, the best thing to do is...

1. zip or tar.gz the files locally
2. scp the archive to the remote machine
3. sshexec to remote machine and unpack the archive

-Rob Anderson

On Wed, Nov 26, 2008 at 3:36 AM, Steve Loughran <st...@apache.org> wrote:

> Rez wrote:
>
>> Hi
>>  Is it possible to create the directories on the remote server on the fly
>> as the scp ant task is executed or do I need to run sshexec to create them
>> first?
>>
>>
>
> I use sshexec first, with a mkdir -p as the command. I also have a couple
> of presetdef definitions to simplify making commands
>
>    <presetdef name="rpmssh">
>      <sshexec host="${rpm.ssh.server}"
>          username="${rpm.ssh.user}"
>          passphrase="${rpm.ssh.passphrase}"
>          trust="${rpm.ssh.trust}"
>          keyfile="${rpm.ssh.keyfile}"
>          timeout="${ssh.command.timeout}"
>          />
>    </presetdef>
>    <presetdef name="rootssh">
>      <rpmssh
>          username="root"
>          timeout="${ssh.rpm.command.timeout}"
>          />
>    </presetdef>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Rob Anderson
riznob@gmail.com

Re: SCP and SSHExec tasks

Posted by Steve Loughran <st...@apache.org>.
Rez wrote:
> Hi
>  
> Is it possible to create the directories on the remote server on the fly as the scp ant task is executed or do I need to run sshexec to create them first?
>  

I use sshexec first, with a mkdir -p as the command. I also have a 
couple of presetdef definitions to simplify making commands

     <presetdef name="rpmssh">
       <sshexec host="${rpm.ssh.server}"
           username="${rpm.ssh.user}"
           passphrase="${rpm.ssh.passphrase}"
           trust="${rpm.ssh.trust}"
           keyfile="${rpm.ssh.keyfile}"
           timeout="${ssh.command.timeout}"
           />
     </presetdef>
     <presetdef name="rootssh">
       <rpmssh
           username="root"
           timeout="${ssh.rpm.command.timeout}"
           />
     </presetdef>

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