L
L
LXSTVAYNE2020-10-11 02:12:52
Python
LXSTVAYNE, 2020-10-11 02:12:52

How to run a python script on ubuntu so that it doesn't shut down?

You need to run the script in the background so that when you close the terminal, it continues to work. How can I do that ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
ge, 2020-10-11
@lxstvayne

There are many options, here's what I came up with on the go:
1. Run the script in bash with nohup .
2. Run the script in a tmux session and just debug from it. The session will continue to run. It's still the same manual launch of the script.
3. Create a systemd service .
4. Run in the background using supervisor .
If you need the script to work and run without human intervention, then options 3 and 4.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question