nohup 后台执行

nohup  默认是当前用户执行的,当当前用户退出会导致执行进程异常。

所以正确的 nohup 是指定 /bin/bash 进行执行。

nohup /bin/bash/ /opt/script/s.sh &> /dev/null
# 记录指定到 /dev/null
# nohup sh /opt/test/s.sh

nohup 执行 默认会自动生成一个  nohup.out 记录文件,会日积月累的越来越大;

猜你喜欢

转载自www.cnblogs.com/sharesdk/p/11141900.html