我有一堆shell脚本,我想对它们进行排序。我可以写一个主要的shell脚本。但我不太擅长shell脚本编程。我听说drake是一个作业控制流工具。我想看看它是否可以用来以集成的方式创建/运行shell脚本
示例:
nohup run shell_script_1.ksh
Once this is successfully complete run next else exit with error code 1
nohup run shell_script_2.ksh &
nohup run shell_script_3.ksh
Once both the scripts run successfully, move to next else exit with error code 2
nohup ksh shell_script_4.ksh&
nohup ksh shell_script_5.ksh&
nohup ksh shell_script_6.ksh&
Once the above 3 scripts complete, move to next else exit with error code3
finally execute
nohup ksh shell_script_4.ksh或者,如果我将运行这些脚本的规则安排在一个YAML文件中,是否有可以使用的主shell脚本生成器?
谢谢,帕里
发布于 2018-01-10 01:30:23
试试这样的东西。将其另存为run_scripts.ksh,然后运行它。
#!/usr/bin/env ksh
trap '' HUP
trap 'echo EXITING DUE TO SIGNAL ; exit 15' INT TERM
${SHELL-ksh} shell_script_1.ksh || exit 1
${SHELL-ksh} shell_script_2.ksh &
${SHELL-ksh} shell_script_3.ksh || exit 2
wait || exit 2
${SHELL-ksh} shell_script_4.ksh &
${SHELL-ksh} shell_script_5.ksh &
${SHELL-ksh} shell_script_6.ksh &
for x in 4 5 6
do
wait || exit 3
done
${SHELL-ksh} shell_script_4.ksh #not 7?
exit $?https://stackoverflow.com/questions/48124108
复制相似问题