バックグラウンドで動かす方法(runserver)

python runserverを開発環境のバックで回していたい時。

$ nohup python apps/manage.py runserver 0.0.0.0:8000 > /dev/null 2>&1 < /dev/null &
$ jobs
$ ps aux | grep runserver
$ %1
$ kill %1

これでいける。disownもあるけど、こっちの方がログアウトしても回せるので便利。

stackoverflow.com

プロセス管理: nohup, disown, kill - Heavy Watal

dev、nullの話

UNIXの部屋 コマンド検索:リダイレクト (*BSD/Linux)