Getting sudo and nohup to work together

后端 未结 9 1850
滥情空心
滥情空心 2021-02-02 06:39

Linux newbie here.

I have a perl script which takes two command line inputs. I tried to run it in the background but this is what I got:

[~user]$ nohup s         


        
9条回答
  •  没有蜡笔的小新
    2021-02-02 07:09

    This should work

    sudo -b -u userName ./myScript > logFile
    

    I am just curious to understand that can I send this logFile as a email after the ./myScript is successful running in background.

提交回复
热议问题