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