开发者

bash: script doesn't run in the background

开发者 https://www.devze.com 2023-03-11 06:44 出处:网络
I have a scrip开发者_运维百科t that performs several linux commands. When I run \"./script.sh &\" it works fine until I cancel the console. However, when I login again the scritp seems to be runni

I have a scrip开发者_运维百科t that performs several linux commands. When I run "./script.sh &" it works fine until I cancel the console. However, when I login again the scritp seems to be running in background but not doing anything.

What can be the problem?

Thanks


You forgot to use nohup when starting it.


nohup {command} 0 2>/dev/null &

should work for you

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号