Hi,
-----Original Message-----
From: Dick, Brian E. [mailto:Brian.Dick@FMR.com]
Sent: Tuesday, February 27, 2007 9:30 PM
To: user@ant.apache.org
Subject: SFTP task
/*
I have the FTP task all over my build files, and now I need to use SFTP.
I don't see an SFTP task. I only see sftp as a parameter for the SCP
task, but SCP has a completely different syntax from FTP and would
require a lot of re-coding.
What's the easiest way to get from FTP to SFTP?
*/
you could use the free maverick ant task =
http://www.sshtools.com/showMaverickAntTask.do
here's a snippet of the examples shipped with that task =
<ssh host="foo.bar.com"
username="lee"
password="********"
version="2">
<exec cmd="ls"/>
<sftp action="mkdir"
remotedir="ant_rules"/>
<sftp action="put" remotedir="ant_rules" verbose="true">
<fileset dir="somejars">
<include name="*.jar"/>
</fileset>
</sftp>
<sftp mode="666" action="chmod" remotedir="ant_rules"
verbose="true">
<fileset>
<include name="*.jar"/>
</fileset>
</sftp>
<exec cmd="tar -zcf archive.tar.gz ant_rules"/>
<exec cmd="passwd">
<read>password:</read>
<write>oldpass</write>
<read>password:</read>
<write>newpass</write>
<read>password:</read>
<write>newpass</write>
</exec>
<sftp action="get">
<filelist
dir="."
files="archive.tar.gz"/>
</sftp>
<sftp action="rmdir" remotedir="ant_rules"/>
</ssh>
seems exactly what you want. The task has a clear syntax and _no_
library dependencies , it only lacks of a resultproperty of it's sub
exec.
But beware = i had some difficulties with maverick using for target
platform AIX, means ssh/sftp transfer from windows to AIX via ant.
After a successful handshake it hung up from time to time.
Others - the support of 3SP Ltd included - couldn't reproduce it and use
the task regularly without difficulties.
Give it a shot.
Regards, Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|