【问题标题】:How can i run my python script in the background in my VPS如何在我的 VPS 后台运行我的 python 脚本
【发布时间】:2020-06-11 15:02:09
【问题描述】:

我有一个 python 脚本,它需要超过 48 小时才能完成执行,我不想在此期间保持我的笔记本电脑和我的 ssh 连接,我现在的问题是如何运行 python 脚本这样即使我从我的 VPS 注销,脚本仍然会在 VPS 中运行

【问题讨论】:

  • 你可以在远程服务器上使用tmux/screen
  • 我该怎么做

标签: python-3.x linux vps


【解决方案1】:

你可以使用 nohup 命令,即使你关闭会话它也会运行

nohup command-to-run-script &

所有输出都将写入一个名为 nohup.out 的文件

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-07
    • 2011-02-27
    • 1970-01-01
    • 2022-12-22
    • 2023-01-22
    • 2022-07-17
    • 1970-01-01
    • 2021-05-17
    相关资源
    最近更新 更多