Why my bot goes offline?

TheGreenTape

Newbie
Joined
Apr 28, 2020
Messages
11
Reaction score
1
Hey evreryone!

I have my own Instagram bot on an Amazon web services VPS. The bot works well while I am connected to the server from my computer. But as soon as I disconnect myself from the VPS (which I do not turn off), the bot stops working. I don't how to do to keep the server working even while I am disconnected from it. I tried to find a solution on Google already, but I can't figure it out. Can someone help me?
Thanks!
 
Program the bot to work based on CMD, works everytym.
 
might be stupid suggestion but have you checked the settings on what it does when you log out? does it run on windows or linux ?
 
If it's Linux run the program as a service or in a screen session type

Code:
screen -S bot
then start the script and detach from the screen pressing CTRL + Shift + D
Once you connect back to your VPS you can run
Code:
screen -r
to see it running
 
If you run a linux server and use ssh tins normal. Script stops when you cut the connection. You need to run your script in a tmux session.
 
Thanks for all your answers guys! It a home made bot, running on windows. What do you mean @Hansj80 by "the settings on what it does when you log out"?
 
But as soon as I disconnect myself from the VPS (which I do not turn off), the bot stops working.

is the bot running in a CMD/power shell window? (is a terminal-based bot)?

If you open the powershell, command line remotely, it will stay open only as long as you keep your connection open.

You can do 2 (almost 3) things:

1. You can try using either Teamviewer or Google chrome RDP to connect to your VPS via desktop sharing and then open the power shell inside your VPS (locally). In this way, the power shell won't be tied to a remote connection.

2. Create a custom run-on-startup script (this might help: https://www.howtogeek.com/138159/how-to-enable-programs-and-custom-scripts-to-run-at-boot/)

(almost the last option) 3. Switch to a linux VPS and create a systemd service.
 
Cheap VPS. Contact the company and ask them to modify the settings. It seems that it logs off, once you disconnect.
 
Thanks for all your answers guys! It a home made bot, running on windows. What do you mean @Hansj80 by "the settings on what it does when you log out"?

As it's windows....it might have been set up to sleep/hybernatewhatever when you click log out or disconnect without logging out.... I would check those settings or ask your host to fix this.
 
I have faced this problem. If your bot depends on clicking coordinates, wait for image then it will not work because as soon as you disconnect your vps loses its resolution like it has no monitor, to solve this issue i used another vps and connect to my previous one then it always works. And obviously the best way is to use terminal bot or bot which do not depends on wait for image or coordinates.
 
That's normal. As soon as you close the terminal, the program should close.
You need something like nohup to keep it running in the background.

E.g. try

nohup yourprogram

Edit: oops, not sure about windows. If it's a bot that works in linux, then try switching to it. You will be amazed how powerful linux can be.
 
Alright, Thank for all those replies, I will try to figure out the problem with your solutions!
 
Thread moved.
 
Back
Top