java调用shell脚本执行操作

    //定时清空 日志
            String shellString = "sh /home/jyapp/delete_log.sh";
            Process process = Runtime.getRuntime().exec(shellString);
            int exitValue = process.waitFor();
            if (0 != exitValue) {
                logger.error("call shell failed. error code is :" + exitValue);
            }

 

posted @ 2017-11-30 13:36  也许还年轻  阅读(1064)  评论(0编辑  收藏  举报