linux - Having problems running python script even when putty is closed -
so basically, have bot i'm running, , maintain running when exit putty.
i've tried using nohup python bot.py &
still ends python bot when close putty program. i've tried using run.sh file /usr/bin/nohup bot.py &
within it. won't work :( there else i'm missing?
i have made sure run.sh executable other forums have suggested, , still can't open run
i'm kinda new linux terminal.
if guys help me out awsome :)
you need detach terminal when exit, still running. can utilize screen
or tmux
or other multiplexer.
here how screen
:
screen -s mybot -m -d /usr/bin/python /path/to/bot.py
-s
give session name (this useful if want attach later. screen -d -r mybot
) -m
create new session -d
detach (launch program, detach terminal returning prompt) linux bots
No comments:
Post a Comment