6

バックグラウンドでトップコマンドを実行するために nohup を使用する際に問題があります。まず、ローカルで実行します。

nohup top &

nohup.outテキストで文句を言いますtop: failed to get tty。私の最終的な目標は、次のようにリモートマシンでトップを実行することです

nohup ssh -t user@hostname top &

現在、上記のコマンドも失敗します

Pseudo-terminal will not be allocated because stdin is not a terminal.^M 
TERM environment variable not set

何か案は?

PS: から ping を実行するには、このコマンドを実行しmachineBますmachineAmachineAは常に生きていますが、常にログインしているわけではありません。

4

1 に答える 1

15

topコマンドの-b(バッチモード)スイッチを試しましたか?

于 2012-10-02T18:31:36.947 に答える