public class CommandJobHandler extends JobHandler
The job handler for executes system operation command.
/bin/bash -c "echo $(date +%Y/%m/%d)"
Runtime.exec(new String[]{"/bin/sh", "-c", "echo $(date +%Y/%m/%d)"});
bin/bash -c 后面接 命令
/bin/bash 后面接 执行的脚本
job_param example:
{
"cmdarray":[
"/bin/sh",
"-c",
"echo $(date +%Y/%m/%d)"
]
}
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CommandJobHandler.CommandParam |
| 构造器和说明 |
|---|
CommandJobHandler() |
public ExecuteResult execute(ExecutingTask executingTask, Savepoint savepoint) throws Exception
TaskExecutorexecute 在类中 TaskExecutorexecutingTask - the executing tasksavepoint - the savepointException - if execute failedCopyright © 2023. All rights reserved.