//定时清空 日志 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); }