xml version="1.0" encoding="UTF-8" ?>
<< span=""> project name ="ssh" >
<< span=""> property file ="ssh.properties" />
<< span=""> tstamp >
<< span=""> format property ="TODAY" pattern ="yyyyMMddHHmm" />
tstamp >
<< span=""> property name ="ssh.path" value ="/data/meganotes/shell/" />
<< span=""> target name ="shell/ 文件 上载/覆盖" >
<< span=""> input addproperty ="scp_coverage_shell_file"
message ="输入(ssh/ 下文件名 \\n\\r 上载或覆盖 到服务器 218 ${ssh.path} ):" >
input >
<< span=""> input
message ="请确定是否使用 ssh/${scp_coverage_shell_file} 覆盖服务器中 ${ssh.host}:${ssh.path}${scp_coverage_shell_file} (y,n)"
validargs ="y,n" addproperty ="do.coverage" defaultvalue ="n" />
<< span=""> condition property ="do.abort" >
<< span=""> equals arg1 ="n" arg2 ="${do.coverage}" />
condition >
<< span=""> fail if ="do.abort" > 退出 fail >
<< span=""> 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 >
<< span=""> scp file ="ssh/${scp_coverage_shell_file}"
todir ="${ssh.myName}:${ssh.myPass}@${ssh.host}:${ssh.path}"
trust ="true" verbose ="true" />
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true"
command ="chmod 777 ${ssh.path}${scp_coverage_shell_file}" >
sshexec >
target >
<< span=""> target name ="shell/ 文件查看" >
<< span=""> input addproperty ="show_shell_file" message ="输入查看文件名(*sh):"
defaultvalue ="*" >
input >
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true"
command ="ls /data/meganotes/shell/${show_shell_file}" >
sshexec >
target >
<< span=""> target name ="shell/ 文件拷贝" >
<< span=""> input addproperty ="scp_shell_file"
message ="输入 /data/meganotes/shell/ 下需要文件名(cp 到 ssh 下):" >
input >
<< span=""> scp
file ="${ssh.myName}:${ssh.myPass}@${ssh.host}:/data/meganotes/shell/${scp_shell_file}"
todir ="ssh" trust ="true" verbose ="true" />
target >
<< span=""> target name ="admin-mvn组合操作" >
<< span=""> exec executable ="cmd" >
<< span=""> arg value ="/c" />
<< span=""> arg value ="${basedir}/sh/mvn/meganotes_mvn_clear.bat" />
exec >
<< span=""> exec executable ="cmd" >
<< span=""> arg value ="/c" />
<< span=""> arg value ="${basedir}/sh/mvn/meganotes_mvn_install.bat" />
exec >
<< span=""> exec executable ="cmd" >
<< span=""> arg value ="/c" />
<< span=""> arg value ="${basedir}/sh/mvn/mn_mod_admin_mvn_intall.bat" />
exec >
target >
<< span=""> target name ="admin-tomcat日志" >
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true" command ="${ssh.adminRunLog}" >
sshexec >
target >
<< span=""> target name ="schedule-tomcat日志" >
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true"
command ="${ssh.scheduleRunLog}" >
sshexec >
target >
<< span=""> target name ="查找2008/下Mp3没转128-64文件夹" >
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true" command ="${ssh.64k}" >
sshexec >
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true" command ="${ssh.128k}" >
sshexec >
<< span=""> sshexec host ="${ssh.host}" username ="${ssh.myName}"
password ="${ssh.myPass}" trust ="true"
command ="${ssh.128kto64k.err}" >
sshexec >
target >
<< span=""> target name ="admin模块测试" >
<< span=""> input addproperty ="admin_test_input"
message ="测试类输入(Video*Test):" defaultvalue ="*Test" >
input >
<< span=""> echo message ="${admin_test_input}" > echo >
<< span=""> exec executable ="cmd" >
<< span=""> arg value ="/c" />
<< span=""> arg
value ="${basedir}/sh/admin_test.bat ${admin_test_input} " />
exec >
target >
project >
<input addproperty="scp_coverage_shell_file"
message="输入(ssh/ 下文件名 \\n\\r 上载或覆盖 到服务器 218 ${ssh.path} ):">
message="请确定是否使用 ssh/${scp_coverage_shell_file} 覆盖服务器中 ${ssh.host}:${ssh.path}${scp_coverage_shell_file} (y,n)"
validargs="y,n" addproperty="do.coverage" defaultvalue="n" />
退出
<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 ;
">
<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}">
<input addproperty="show_shell_file" message="输入查看文件名(*sh):"
defaultvalue="*">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="ls /data/meganotes/shell/${show_shell_file}">
<input addproperty="scp_shell_file"
message="输入 /data/meganotes/shell/ 下需要文件名(cp 到 ssh 下):">
file="${ssh.myName}:${ssh.myPass}@${ssh.host}:/data/meganotes/shell/${scp_shell_file}"
todir="ssh" trust="true" verbose="true" />
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.adminRunLog}">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="${ssh.scheduleRunLog}">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.64k}">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.128k}">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="${ssh.128kto64k.err}">
<input addproperty="admin_test_input"
message="测试类输入(Video*Test):" defaultvalue="*Test">
value="${basedir}/sh/admin_test.bat ${admin_test_input} " />
执行Linux下的命令时可以用分号";"把多个命令隔开,它们将会依次执行,而不需要写多个sshexec进行多次连接,每次连接只执行一个命令。