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() |
| 限定符和类型 | 方法和说明 |
|---|---|
ExecuteResult |
execute(ExecutingTask executingTask,
Savepoint savepoint)
Executes task
|
protected void |
onStop()
On stop
|
destroy, init, isStopped, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsplitprotected void onStop()
TaskExecutoronStop 在类中 TaskExecutorpublic ExecuteResult execute(ExecutingTask executingTask, Savepoint savepoint) throws Exception
TaskExecutorexecute 在类中 TaskExecutorexecutingTask - the executing tasksavepoint - the savepointException - if execute failedCopyright © 2024. All rights reserved.