nohup python -u filename.py > logfilename 2>&1 &
ps ax | grep filename.py
: PID 조회
kill <pid>
pythonw -u filename.py > logfilename 2>&1
TASKKILL /F /IM pythonw.exe
FILE=.tmp_saved_pid
if [ ! -f "$FILE" ]; then
nohup python3 -u main.py > output.log 2>&1 &
echo $! > .tmp_saved_pid
echo "Start running TradeBot"
else
echo "TradeBot is already running"
fi
FILE=.tmp_saved_pid
if [ -f "$FILE" ]; then
kill `cat .tmp_saved_pid`
rm .tmp_saved_pid
echo "TradeBot stopped"
else
echo "TradeBot is not running"
fi