S
S
Sergey2020-06-10 21:24:45
linux
Sergey, 2020-06-10 21:24:45

Two telegram bots on VPS with ubuntu?

Friends, I purchased a vps with ubuntu using the remoteness guide to run one
bot.service bot in /etc/systemd/system

[Unit]
Description=Telegram bot 'Town Wars'
After=syslog.target
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/usr/local/bin/bot
ExecStart=/usr/bin/python3 /usr/local/bin/bot/bot.py
RestartSec=10
Restart=always
 
[Install]
WantedBy=multi-user.target


then in the console:
systemctl daemon-reload
systemctl enable bot
systemctl start bot
systemctl status bot

I tried to run another bot in parallel in the same way, but alas, it doesn’t want to, what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Vasilyev, 2020-06-11
@zabigun

Make 2 copies:
bot.service
bot2.service (make appropriate changes in the file itself)
2 copies:
/usr/local/bin/bot
/usr/local/bin/bot2
2 copies:
/usr/local/bin/bot/ bot.py
/usr/local/bin/bot2/bot2.py
Well, in the console, the same thing with connecting the service, but for bot2

A
Andrey Barbolin, 2020-06-10
@dronmaxman

And what does the systemd file look like for the second bot?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question