如何在Ubuntu服务器的后台运行Python程序

Ser*_*hii 6 python selenium nohup server ubuntu-16.04

我有一个python脚本.脚本与Chrome一起使用selenium并访问网站,获取数据并输入CSV文件.
这是一项非常漫长的工作.
我把脚本放在服务器上.并运行.一切工作.但我需要在后台编写脚本.

chmod +x createdb.py
nohup python ./createdb.py &
Run Code Online (Sandbox Code Playgroud)

我明白了

(env)$ nohup ./createdb.py &
[1] 32257
(env)$ nohup: ignoring input and appending output to 'nohup.out'
Run Code Online (Sandbox Code Playgroud)

按Enter键.

(env)$ nohup ./createdb.py &
[1] 32257
(env)$ nohup: ignoring input and appending output to 'nohup.out'
[1]+  Exit 1                  nohup ./createdb.py
Run Code Online (Sandbox Code Playgroud)

然后它运行并立即将错误写入文件,Chrome没有启动或没有点击.
我想提醒你,如果你没有nohup开始,那么一切都会奏效.
我究竟做错了什么?如何运行脚本?
非常感谢你.

Jon*_*IAR 2

您可以使用 screen 命令,效果很好。

这是一个非常好的链接:https ://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/