shell脚本后台运行

shell脚本后台运行

20191024


  • nohup ( no hang up)
    (CTRL-C)无效,但是关掉终端会终止执行

  • & (后天执行)
    (CTRL-C)有效,但是关掉终端不会终止执行

  • 一般配合使用


nohup sh my.sh >my.log 2>&1 &

参考

参考1
参考2
参考3

原文地址:https://www.cnblogs.com/damahuhu/p/11732844.html