Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要远程登录到服务器并在后台使用nohup. 但我收到一个错误。我在语法上遗漏了什么吗?
nohup
我的代码:
ssh -t -t user@servername nohup /path/myscript.sh argument1 argument2 & > /path/myscrip_logfile.log
输出:
Invalid null command.
nohup 接受您提供的参数,“& >”应该是“&>”,并且整个命令应该放在引号中,否则我认为您正在重定向 ssh 命令的标准输出,所以试试这个:
ssh -t -t user@servername "nohup /path/myscript.sh argument1 argument2 &> /path/myscrip_logfile.log"