码迷,mamicode.com
首页 > 编程语言 > 详细

【笔记】【Informatica】Java组件调用ssh客户端远程执行linux系统上的shell脚本

时间:2015-08-14 15:35:40      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:

 try{
    String cmdStr="C:\\SSH\\ssh2.exe azik@172.16.20.1 /home/azik/tmp/echo_date.sh";
    Process mypro=Runtime.getRuntime().exec(cmdStr);
    mypro.waitFor();
    Integer errno=mypro.exitValue();
    logInfo("The errorlevel is :"+errno);
    mypro.destroy();
    if (errno != 0)  {
        logError("Execute Cmd Fail.");
        failSession("Catch Exception!");
    }
    

} catch(Exception e) {
    logError(e.toString());
    failSession("Catch Exception!");

【笔记】【Informatica】Java组件调用ssh客户端远程执行linux系统上的shell脚本

标签:

原文地址:http://www.cnblogs.com/AzikPhil/p/Informatica_Java_SSH.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!