On my truenas scale machine, I have a container for gluetun and one for qbittorrent (among others). Maybe a couple times a week, I notice that the VPN connection gets flakey. Qbittorrent speeds go down into the kb/s range. This promps me to carry out an annoying, manual process:
- I pause all torrents in qbittorrent webui
- I stop both the qbit and gluetun containers
- I start the gluetun container
- I give the gluetun container adequate time to connect (since the qbit container depends on the gluetun network, attempting to start both at the same time yields an error on the qbit side)
- I start the qbit container
- I resume all torrents in the qbittorrent webui
Is there any easy way to automate this process? Preferably one that doesn’t require me to learn ansible? I’m hoping the solution could all be done via portainer - which I use.
Thank you in advance.
I would investigate what is actually causing the connection to slow, but you can just run
docker restart gluetun qbittorrent
from cron or whatever.Cronjob and a bash script?
You’re thinking i could make a bash script that pauses all torrents and a cronjob that restarts containers with some timing built in?
You could definitely do that. I use this to manage torrents from the command line and in scripts
Yeah. Example: if pings get flakey, or can’t curl address, then restart all the things.
Doesn’t need to stop torrents, just close the app, restart networking, and start it again.
Make sure everything starts automatically after a reboot, and reboot daily.