linux python running in the background, and viewing log

nohup python -u run.py >  run.log 2>&1 &

The final & means running in the background

2 outputs an error message to prompt window

1 represents the output information to the prompt window, front & 1 added attention, otherwise will create a file named 1

Finally, the log file will output to a file run.log

Guess you like

Origin www.cnblogs.com/wangyuqi6688/p/11319543.html