Script ending after 2 - 3 hours. #1
Open
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script is automatically ending itself every 2 to 3 hours, taking the bot offline. I haven't explored the issue at all, I immediately created a Cron job using:
* 1 * * * nohup python3 -u ~/fenrirbot/bot.py &
What's this Cron job do?
This executes
nohup python3 -u ~/fenrirbot/bot.py &
every hour to prevent the bot from going offline. This is my temporary work around until I take the time to look into the issue because programming, yeeyyyy.Why are you including
nohup
?I'm using Termius to remotely access my Raspberry Pi, this will ignore the hangup signal so the script doesn't terminate once I close my SSH connection.
What's the
&
for?Runs the script in the background so you can still access the terminal.
Kill the task
Since I'm running the task as a background task, you can use
$ ps aux | grep python3
to find the PID and then run$ sudo kill -9 TASK_PID
.The text was updated successfully, but these errors were encountered: