I have a Python file that needs to be constantly running (a Telegram bot), but if I run in the background
python bot.py &
and then gracefully end the SSH connection, after a while the bot stops responding and I have to connect and launch it again.
How can I stop this from happening? If i cannot, how can I check when it is dead and relaunch it?