Automatically throttling rtorrent
I’ve been wondering how to get rtorrent to stop downloading while I’m working and go full throttle when I’m not. Even more so because I share my internet connection with 30 other people, and I can tell you, they get mad pretty fast
It would be nice to have a cronjob(Cron) that slows down the network load at, let’s say, 8 o’Clock in the morning and put it back full speed after 1 AM. Luckily since I already have rtorrent running in a screen instance to detach it from the console I can use the -X parameter which passes keystrokes on to the running program.
If I started rtorrent with the following command
$ screen -dmS rtorrent rtorrent
which creates a new, detached, screen with the name rtorrent and executes rtorrent, then I’d add the following to my crontab:
0 1 * * * screen -r rtorrent -X stuff CCCCC
0 1 * * * screen -r rtorrent -X stuff ccccc
0 7 * * * screen -r rtorrent -X stuff S
0 7 * * * screen -r rtorrent -X stuff s
What this does is, at 1 AM, remove up to 250KB/s limit (never put in more or the limit won’t be lifted) and at 7 AM throttle all uploads and downloads to 5KB/s.
Alternatively I could kill the rtorrent instance and restart it, but by doing it this way I can still use the web interface and I don’t have to preform hash checks as often (your disk will thank you).
Any better idea? Feel free to comment:D
