我有两个要永久运行的进程,但我想在它们仍在运行时继续使用相同的Shell脚本来执行命令。
我尝试过永远使用,但是似乎无法正常工作。
npm install forever -g
forever start scripts/node1_start.sh
forever start scripts/node2_start.sh
有什么想法吗?
答案 0 :(得分:0)
正如@rhubarbdog所指出的那样,在后台运行 2 外部 shell脚本将使您能够继续在当前执行命令(不受阻碍)脚本。
sh scripts/node1_start.sh &
sh scripts/node2_start.sh &
# Do commands here