E
E
Elvis2019-05-06 13:33:31
Python
Elvis, 2019-05-06 13:33:31

How to organize the launch of scripts on the server?

There is a VDS server with ubuntu. I want to organize several telegram bots on it, as well as raise the rest service. Advise articles, otherwise the variety of ways is darkness.
Of course, I would like a single system, like this can be done on Flask, but I have never worked with it.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Z
zohan1993, 2019-05-08
@Dr_Elvis

1. Virtual environment for the bot
virtualenv --python=/usr/bin/python3.5 /srv/venv/telegram-bot-1
source /srv/venv/telegram-bot-1/bin/activate
pip install -r requirements. txt
2. Systemd service for bot
/etc/systemd/system/telegram-bot-1.service
----------------------- --------------------
[Unit]
Description=Telegram bot
After=syslog.target
After=network.target
[Service]
Type=simple
User=root
ExecStart=/srv /venv/telegram-bot-1/bin/python3.5 /usr/local/bin/telegram-bot-1/bot.py
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
-------------------------------------------------
systemctl daemon-reload
systemctl start telegram-bot-1.service
systemctl enable telegram-bot-1.service

D
Dmitry Gololobov, 2019-05-06
@dGololobov

cron?

Q
qlkvg, 2019-05-06
@qlkvg

easy way
less popular easy way
linux-way way

F
Fixid, 2019-05-06
@Fixid

supervisor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question