背景
リモートのmacサーバにsshでログインして、バックグラウンドで動かし続ける、
っていうのを、数ヶ月に1度くらいの頻度でやるのですが、
shell力が低くていつもやり方を忘れるので方法をまとめました。
ssh でログイン
cd ~/.ssh
ssh -i ./server-id_rsa admin@xxx.xxx.xxx.xxx -p yyyyy
xxx = アドレス
yyyy = ポート番号
参考
http://webkaru.net/linux/ssh-command/
バックグラウンドで起動
nohup redis-server < /dev/null 2>&1 /dev/null &
nohup ./run.sh &
参考
http://qiita.com/tsuyoshi_cho/items/bb385304481ea8fd3ce1
間違って起動したredis-serverを終了
redis-cli
shutdown
参考
http://qiita.com/yoh-nak/items/69c26e7d627e2b5a95e2
間違って起動したshellを終了
ps
kill -SIGINT xxxxx
または
kill -SIGTERM xxxxx
xxxxx = プロセスID
参考
http://equj65.net/tech/linuxprocessgroup/
まとめ
shell力が高いとPCのとこまでに行かなくてすむ