How to make linux program keep running after ssh shell is closed

1. Run the script in the ssh shell, for example, I run a batch download script:
python download-app-annie.py

2. Press ctrl-z to interrupt the script running, and the system prompts:
^Z
[1]+ Stopped python download -app-annie.py
means that the task numbered 1 is suspended, [1] is the number of the task, and the number in it may also be 2, 3, 4..
3. Enter the command: bg 1
This command will make number 1 The task is switched to the background for execution
4. Enter the command: disown -h %1
This command means to remove the task No. 1 from the task list of the current shell, and ignore the HUP signal, so that even if the current shell ends, this task will be will not be terminated, but will continue to execute in the background.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327001099&siteId=291194637