<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 165, comments - 198, trackbacks - 0, articles - 1
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    強(qiáng)大的 ant scp 和 sshexec

    Posted on 2008-12-24 16:24 G_G 閱讀(6386) 評論(3)  編輯  收藏 所屬分類: ant

    <? xml?version="1.0"?encoding="UTF-8" ?>
    < project? name ="ssh" >
    ????
    < property? file ="ssh.properties" ? />
    ????
    < tstamp >
    ????????
    < format? property ="TODAY" ?pattern ="yyyyMMddHHmm" ? />
    ????
    </ tstamp >
    ????
    < property? name ="ssh.path" ?value ="/data/meganotes/shell/" ? />


    ????
    < target? name ="shell/?文件?上載/覆蓋" >
    ????????
    < input? addproperty ="scp_coverage_shell_file"
    ????????????message
    ="輸入(ssh/?下文件名?\n\r?上載或覆蓋?到服務(wù)器?218?${ssh.path}?):" >
    ????????
    </ input >
    ????????
    < input
    ????????????
    message ="請確定是否使用?ssh/${scp_coverage_shell_file}?覆蓋服務(wù)器中?${ssh.host}:${ssh.path}${scp_coverage_shell_file}?(y,n)"
    ????????????validargs
    ="y,n" ?addproperty ="do.coverage" ?defaultvalue ="n" ? />
    ????????
    < condition? property ="do.abort" >
    ????????????
    < equals? arg1 ="n" ?arg2 ="${do.coverage}" ? />
    ????????
    </ condition >
    ????????
    < fail? if ="do.abort" > 退出 </ fail >

    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true"
    ????????????command
    ="
    ????????????????????mkdir?-p?${ssh.path}backup/${TODAY}?;
    ????????????????????if?[?-f?${ssh.path}${scp_coverage_shell_file}???]?;
    ????????????????????then??
    ????????????????????????cp?${ssh.path}${scp_coverage_shell_file}?${ssh.path}backup/${TODAY}/?;
    ????????????????????fi?;
    ????????"
    >
    ????????
    </ sshexec >
    ????????
    < scp? file ="ssh/${scp_coverage_shell_file}"
    ????????????todir
    ="${ssh.myName}:${ssh.myPass}@${ssh.host}:${ssh.path}"
    ????????????trust
    ="true" ?verbose ="true" ? />

    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true"
    ????????????command
    ="chmod?777?${ssh.path}${scp_coverage_shell_file}" >
    ????????
    </ sshexec >
    ????
    </ target >

    ????
    < target? name ="shell/?文件查看" >
    ????????
    < input? addproperty ="show_shell_file" ?message ="輸入查看文件名(*sh):"
    ????????????defaultvalue
    ="*" >
    ????????
    </ input >
    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true"
    ????????????command
    ="ls??/data/meganotes/shell/${show_shell_file}" >
    ????????
    </ sshexec >
    ????
    </ target >

    ????
    < target? name ="shell/?文件拷貝" >
    ????????
    < input? addproperty ="scp_shell_file"
    ????????????message
    ="輸入?/data/meganotes/shell/?下需要文件名(cp?到?ssh?下):" >
    ????????
    </ input >
    ????????
    < scp
    ????????????
    file ="${ssh.myName}:${ssh.myPass}@${ssh.host}:/data/meganotes/shell/${scp_shell_file}"
    ????????????todir
    ="ssh" ?trust ="true" ?verbose ="true" ? />
    ????
    </ target >



    ????
    < target? name ="admin-mvn組合操作" >
    ????????
    < exec? executable ="cmd" >
    ????????????
    < arg? value ="/c" ? />
    ????????????
    < arg? value ="${basedir}/sh/mvn/meganotes_mvn_clear.bat" ? />
    ????????
    </ exec >
    ????????
    < exec? executable ="cmd" >
    ????????????
    < arg? value ="/c" ? />
    ????????????
    < arg? value ="${basedir}/sh/mvn/meganotes_mvn_install.bat" ? />
    ????????
    </ exec >
    ????????
    < exec? executable ="cmd" >
    ????????????
    < arg? value ="/c" ? />
    ????????????
    < arg? value ="${basedir}/sh/mvn/mn_mod_admin_mvn_intall.bat" ? />
    ????????
    </ exec >
    ????
    </ target >


    ????
    < target? name ="admin-tomcat日志" >
    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true" ?command ="${ssh.adminRunLog}" >
    ????????
    </ sshexec >
    ????
    </ target >

    ????
    < target? name ="schedule-tomcat日志" >
    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true"
    ????????????command
    ="${ssh.scheduleRunLog}" >
    ????????
    </ sshexec >
    ????
    </ target >
    ????
    < target? name ="查找2008/下Mp3沒轉(zhuǎn)128-64文件夾" >
    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true" ?command ="${ssh.64k}" >
    ????????
    </ sshexec >
    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true" ?command ="${ssh.128k}" >
    ????????
    </ sshexec >
    ????????
    < sshexec? host ="${ssh.host}" ?username ="${ssh.myName}"
    ????????????password
    ="${ssh.myPass}" ?trust ="true"
    ????????????command
    ="${ssh.128kto64k.err}" >
    ????????
    </ sshexec >
    ????
    </ target >

    ????
    < target? name ="admin模塊測試" >
    ????????
    < input? addproperty ="admin_test_input"
    ????????????message
    ="測試類輸入(Video*Test):" ?defaultvalue ="*Test" >
    ????????
    </ input >
    ????????
    < echo? message ="${admin_test_input}" ></ echo >
    ????????
    < exec? executable ="cmd" >
    ????????????
    < arg? value ="/c" ? />
    ????????????
    < arg
    ????????????????
    value ="${basedir}/sh/admin_test.bat?${admin_test_input}?" ? />
    ????????
    </ exec >
    ????
    </ target >
    </ project >


    評論

    # re: 強(qiáng)大的 ant scp 和 sshexec   回復(fù)  更多評論   

    2008-12-24 16:24 by G_G


    <?xml version="1.0" encoding="UTF-8"?>
    <project name="ssh">
    <property file="ssh.properties" />
    <tstamp>
    <format property="TODAY" pattern="yyyyMMddHHmm" />
    </tstamp>
    <property name="ssh.path" value="/data/meganotes/shell/" />


    <target name="shell/ 文件 上載/覆蓋">
    <input addproperty="scp_coverage_shell_file"
    message="輸入(ssh/ 下文件名 \n\r 上載或覆蓋 到服務(wù)器 218 ${ssh.path} ):">
    </input>
    <input
    message="請確定是否使用 ssh/${scp_coverage_shell_file} 覆蓋服務(wù)器中 ${ssh.host}:${ssh.path}${scp_coverage_shell_file} (y,n)"
    validargs="y,n" addproperty="do.coverage" defaultvalue="n" />
    <condition property="do.abort">
    <equals arg1="n" arg2="${do.coverage}" />
    </condition>
    <fail if="do.abort">退出</fail>

    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true"
    command="
    mkdir -p ${ssh.path}backup/${TODAY} ;
    if [ -f ${ssh.path}${scp_coverage_shell_file} ] ;
    then
    cp ${ssh.path}${scp_coverage_shell_file} ${ssh.path}backup/${TODAY}/ ;
    fi ;
    ">
    </sshexec>
    <scp file="ssh/${scp_coverage_shell_file}"
    todir="${ssh.myName}:${ssh.myPass}@${ssh.host}:${ssh.path}"
    trust="true" verbose="true" />

    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true"
    command="chmod 777 ${ssh.path}${scp_coverage_shell_file}">
    </sshexec>
    </target>

    <target name="shell/ 文件查看">
    <input addproperty="show_shell_file" message="輸入查看文件名(*sh):"
    defaultvalue="*">
    </input>
    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true"
    command="ls /data/meganotes/shell/${show_shell_file}">
    </sshexec>
    </target>

    <target name="shell/ 文件拷貝">
    <input addproperty="scp_shell_file"
    message="輸入 /data/meganotes/shell/ 下需要文件名(cp 到 ssh 下):">
    </input>
    <scp
    file="${ssh.myName}:${ssh.myPass}@${ssh.host}:/data/meganotes/shell/${scp_shell_file}"
    todir="ssh" trust="true" verbose="true" />
    </target>



    <target name="admin-mvn組合操作">
    <exec executable="cmd">
    <arg value="/c" />
    <arg value="${basedir}/sh/mvn/meganotes_mvn_clear.bat" />
    </exec>
    <exec executable="cmd">
    <arg value="/c" />
    <arg value="${basedir}/sh/mvn/meganotes_mvn_install.bat" />
    </exec>
    <exec executable="cmd">
    <arg value="/c" />
    <arg value="${basedir}/sh/mvn/mn_mod_admin_mvn_intall.bat" />
    </exec>
    </target>


    <target name="admin-tomcat日志">
    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true" command="${ssh.adminRunLog}">
    </sshexec>
    </target>

    <target name="schedule-tomcat日志">
    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true"
    command="${ssh.scheduleRunLog}">
    </sshexec>
    </target>
    <target name="查找2008/下Mp3沒轉(zhuǎn)128-64文件夾">
    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true" command="${ssh.64k}">
    </sshexec>
    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true" command="${ssh.128k}">
    </sshexec>
    <sshexec host="${ssh.host}" username="${ssh.myName}"
    password="${ssh.myPass}" trust="true"
    command="${ssh.128kto64k.err}">
    </sshexec>
    </target>

    <target name="admin模塊測試">
    <input addproperty="admin_test_input"
    message="測試類輸入(Video*Test):" defaultvalue="*Test">
    </input>
    <echo message="${admin_test_input}"></echo>
    <exec executable="cmd">
    <arg value="/c" />
    <arg
    value="${basedir}/sh/admin_test.bat ${admin_test_input} " />
    </exec>
    </target>
    </project>

    # re: 強(qiáng)大的 ant scp 和 sshexec   回復(fù)  更多評論   

    2008-12-24 17:06 by congdepeng@126.com
    ant
    真的很淫蕩

    # re: 強(qiáng)大的 ant scp 和 sshexec   回復(fù)  更多評論   

    2009-03-13 15:02 by megapon
    ant
    真是淫爆
    主站蜘蛛池模板: 亚洲国产美国国产综合一区二区| 久草免费手机视频| 亚洲人成黄网在线观看| 亚洲人成亚洲人成在线观看| 免费激情视频网站| 国产精品成人免费福利| 免费观看一区二区三区| 国产黄在线播放免费观看| 国产成人亚洲精品播放器下载 | 无码AV动漫精品一区二区免费| 亚洲一区中文字幕在线电影网 | 日本一区二区免费看| 欧洲精品码一区二区三区免费看| 亚洲一区二区观看播放| 亚洲人成电影青青在线播放| 亚洲精品午夜在线观看| 亚洲黄网在线观看| 亚洲国产精品久久66| 亚洲AV中文无码字幕色三| 亚洲永久精品ww47| 激情97综合亚洲色婷婷五| 亚洲精品国产精品乱码不卡| 亚洲成av人片在线观看天堂无码| 全黄a免费一级毛片人人爱| 免费看少妇作爱视频| 四虎影院免费视频| 暖暖免费高清日本中文| 午夜视频免费观看| 免费无码黄动漫在线观看| 成人毛片免费观看视频大全| 成人在线视频免费| 永久黄网站色视频免费观看| 日本免费人成视频播放| 成人爱做日本视频免费| 国产裸模视频免费区无码| 免费国产在线观看老王影院| 亚洲国产精品碰碰| 狠狠色伊人亚洲综合成人| 亚洲av午夜成人片精品网站 | 午夜免费福利小电影| 88xx成人永久免费观看|