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 コマンドの stdout をリダイレクトしていると思うので、これを試してください。
ssh -t -t user@servername "nohup /path/myscript.sh argument1 argument2 &> /path/myscrip_logfile.log"