try{
String cmdStr="C:\\SSH\\ssh2.exe [email protected] /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!");
}
时间: 2024-10-09 17:11:29