Run python script as daemon at boot time (Ubuntu)

前端 未结 3 1875
你的背包
你的背包 2020-12-13 05:14

I\'ve created small web server using werkzeug and I\'m able to run it in usual python way with python my_server.py. Pages load, everything works fine. Now I wan

3条回答
  •  北海茫月
    2020-12-13 05:42

    One simple way to do is using crontab:

    $ crontab -e
    

    A crontab file will appear for editing, write the line at the end:

    @reboot python myserver.py
    

    and quit. Now, after each reboot, the cron daemon will run your myserver python script.

提交回复
热议问题