How to queue torrents in Transmission

I have been using Transmission bit torrent client for quite some time. Its powerful, runs in the background, is processor friendly ( maximum that i have seen it use is 5% that too on a P4 1.7GHz system with more than 75 torrents).
But what I find it lacking is its ability to queue torrents. Still at version 1.83 1.92 (which is what I am using currently) and no queuing …
.Only the Mac version supports queuing.
So in search of the holy grail I landed up at this Transmission discussion forum thread and found this queue script.
Even though the script worked well, I found that the script had some short comings.
I had added a bunch of torrents to seed them, when I found that the script (scheduled to run at an interval of 5 minutes) stopped the newly added torrents which were being verified or were scheduled to be verified before seeding.
A little poking into the script and I saw that the script stops all those torrents (if it is greater than the number that has been specified in the MAXDOWN parameter) which don’t report a status of Stopped.
Since newly added torrents for seeding only report a status of Verifying or Will Verify for currently being hashed or scheduled for being hashed respectively, hence the script was stopping those torrents also.
I went ahead and added those two parameter to the script and voila… the torrents that i added for seeding, got verified aka hashed completely and went into seeding state and the next it queue continued.
Script Source : The updated script can be found at github: sevensins / Transmission-daemon-torrent-queue.
Replace the following variables :
- USERNAME : The default username for transmission-remote is transmission
- PASSWORD : The default password for transmission-remote is transmission
- MAXDOWN : This is the maximum number of torrents that you would like to have in queue for downloading
- MAXACTIVE : This is the maximum number of active torrents in your list.
Save the script to a suitable location and use cron to schedule it to run every 5 minutes or whatever time you deem suitable and enjoy your Transmission.
UPDATE [11-July-2010]:
As pointed out by Bogdan please replace awk with gawk if you plan to use this on Ubunut 9.10 x64 server since there is complain with strtonum.
Say, you got a nice post.Really thank you!
Hi Shelby,
Thanks and glad that you liked it
Is this script compatible with Transmission 2.x?
I haven’t tried it with Transmission 2.x but it should work.
Do test it and let me know
DOWNTOSTOP=”$($CMD -l | tail –lines=+2 | grep -v 100% | grep -v Sum | grep -v Stopped | | grep -v Verifying | grep -v Will\ Verify | tail -n $(expr $DOWNACTIVE – $MAXDOWN) | awk ‘{ print $1; }’)”
It gave an error until i removed one | after ” .. grep -v Stopped”
Also i had to use gawk instead of awk on Ubuntu 9.10 server x64, because it complained about strtonum
Hi Bogdan,
Thanks for pointing out the error :thumbup: . Updated the code.
Also thanks for pointing out the Ubuntu 9.10 server x64 issue.
Great its working.
But how do I prioritize a particular torrent?
Hi Vivek,
Sorry for the late reply.
Currently i have no solution for prioritising a particular torrent other than make sure that you add the torrents to the queue as per your liking
it looks like transmission 2.40b has native queuing, but i still prefer this method
… just because i get to choose which torrents get on the bus
our ISP does some nasty throttling ( … dial up speed )
if they sniff ANY public torr traffic between 4pm-2am
… so we start only the private/secure torrs during “prime-time”
hope this helps
$diff transmission-queue.new transmission-queue.org
> DOWNTOSTART=”$($CMD -l | tail –lines=+2 | grep -v 100% | grep Stopped | \
> head -n $(expr $MAXDOWN – $DOWNACTIVE) | awk ‘{ print $1; }’)”
—
< DOWNLIST="$($CMD -l | tail –lines=+2 | grep -v 100% | grep Stopped | awk '{ print $1; }')"
<
< if [ $(date +%H) -ge 16 ] || [ $(date +%H) -lt 2 ]; then
< DOWNLISTPRIVATE="$DOWNLIST"
< for ID in $DOWNLIST; do
< PUBLIC="$($CMD –torrent $ID –info | grep 'Public torrent')"
< [ "${PUBLIC#*Public torrent: }" = "Yes" ] && DOWNLISTPRIVATE="$(echo "$DOWNLISTPRIVATE" | grep -v $ID)"
< done
< $LOGCMD throttle.h4k: $(expr $(echo "$DOWNLIST" | wc -l) – $(echo "$DOWNLISTPRIVATE"|wc -l)) public excluded from starting
< DOWNLIST="$DOWNLISTPRIVATE"
< fi
< DOWNTOSTART="$(echo "$DOWNLIST" | head -n $(expr $MAXDOWN – $DOWNACTIVE) )"
<
Hi Zosky,
Thanks for the time scheduler part
I will modify the script to accommodate the change.
Btw, is the native queuing available to platforms others than OSX ?
Appericiaton for this information is over 9000-thank you!
Hi Kaedn,
Glad that you found this useful
Is there a way to have it clean up the queue of all completed torrents after they are stoped ?
It’s too complicated to modify it my self.
Thanks, this script is a real saver !
Hi Rek,
Is it like that you would like to remove all completed torrents from queue ??