2010.07.09 00:41

[ftp]
<?xml version="1.0"?>
<project default="upload" basedir=".">
<!--
 <echo message="pulling in property files"/>
 <property file="axisservice.properties"/>
-->
<echo message="필살 게으름 신공 ant ftp업롯~!"/>
 <target name="upload" >
  <ftp server="kozazz.iptime.org"
         port="21"
         remotedir="/var/lib/web/jnlp/sms"
         userid="id"
         password="passwd"
         depends="yes">
   <fileset dir="web/dist">
    <include name="**/*"/>
    <exclude name="upload/**/*"/>
   </fileset>
  </ftp>
 </target>
</project>

[sftp]
<?xml version="1.0" encoding="UTF-8"?>
<project name="SFTP_TO_SERVER" default="upload" basedir=".">
 <property name="ftp.server" value="kozazz.iptime.org" />
 <property name="ftp.port" value="22" />
 <property name="ftp.home.dir" value="/var/lib/web/jnlp/sms" />
 <property name="ftp.userid" value="id" />
 <property name="ftp.pw" value="paswd" />
 <taskdef name="ssh" classname="com.sshtools.ant.Ssh" />
 <target name="upload">
  <ssh host="${ftp.server}" port="${ftp.port}" username="${ftp.userid}" password="${ftp.pw}" version="2">
   <sftp action="put" remotedir="${ftp.home.dir}" verbose="true">
    <fileset dir="./dist">
     <modified update="true" seldirs="true" cache="propertyfile" algorithm="digest" comparator="equal">
      <param name="cache.cachefile" value="cache.properties" />
      <param name="algorithm.algorithm" value="MD5" />
     </modified>
     <include name="**/*" />
     <exclude name=".settings/**" />
     <exclude name=".project" />
     <exclude name="chche.properties" />
    </fileset>
   </sftp>
  </ssh>
 </target>
</project>

http://cafe.naver.com/neloi.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=146

* ftp 수행시 라이브러리 추가 필요. ftp는 oro, commons-net 추가 필요

Commons Net:(http://archive.apache.org/dist/commons/net/binaries/)

ORO:(http://archive.apache.org/dist/jakarta/oro/binaries/)



* ant run time library 에 maverick-ant 라이브러리를 추가해줘야 sftp는 수행가능하다


참고
cache.properies 파일에서 업로드 파일 목록을 관리한다. 수정 된 파일만 업로드 된다
신고

'ide > eclipse' 카테고리의 다른 글

junit] mock 객체 이용 test  (0) 2010.09.16
plugin 개발  (1) 2010.08.04
ant ftp, sftp upload  (2) 2010.07.09
Posted by 길동 필명 수식어 덕소 큰아들

티스토리 툴바