It is currently Sat May 25, 2013 8:30 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: What is order by which transmission picks up torrents
PostPosted: Wed Jan 11, 2012 6:26 am 
Super Tonidoid
Super Tonidoid
Joined: Sat Nov 07, 2009 2:02 pm
Posts: 47

Is there a way to define how Transmission picks up torrents?

I had 2 torrents in queue and have configured Transmission to work on at max 2 torrents at a time. When I added a 3rd one, it moved to paused (as expected).

Now, after a power outage, when tonido rebooted, Transmission picked up the 3 torrents in a different order. Torrent#1 was at 45% and Torrent#2 was at 65%. When Tonido rebooted, transmission picked up Torrent#1 & Torrent#3. So Torrent#3 started, keeping Torrent#2 pending. When I checked using torrent-remote, i can see that ID for each torrent was changed during restart.

Can someone help me with defining in which order Transmission picks up torrents to download?


Offline
 Profile  
 Post subject: Re: What is order by which transmission picks up torrents
PostPosted: Wed Jan 11, 2012 7:30 am 
Tonido MVP
Tonido MVP
Joined: Fri Oct 21, 2011 8:20 pm
Posts: 295

mathewparet wrote:
Can someone help me with defining in which order Transmission picks up torrents to download?

Try: https://forum.transmissionbt.com/


Offline
 Profile  
 Post subject: Re: What is order by which transmission picks up torrents
PostPosted: Wed Jan 11, 2012 7:57 am 
Super Tonidoid
Super Tonidoid
Joined: Sat Nov 07, 2009 2:02 pm
Posts: 47

I can see that this has been raised as an issue in transmissionbt issue tracker.


Offline
 Profile  
 Post subject: Re: What is order by which transmission picks up torrents
PostPosted: Mon Jan 23, 2012 1:21 am 
Super Tonidoid
Super Tonidoid
Joined: Sat Nov 07, 2009 2:02 pm
Posts: 47

Meanwhile I have done a shell script which you can add to crontab that will force Transmission to download torrents in the order by which the torrent file was added to transmission.

I'll provide the script by evening.


Offline
 Profile  
 Post subject: Re: What is order by which transmission picks up torrents
PostPosted: Sun Jan 29, 2012 12:58 am 
Super Tonidoid
Super Tonidoid
Joined: Sat Nov 07, 2009 2:02 pm
Posts: 47

Please find the code below. You can add this to the crontab:



Code:
#!/bin/bash
{
TR_USER=<USERNAME>
TR_PASS=<PASSWORD>
TR_MAX_ACTIVE=<MAX_ACTIVE_TORRENTS>

TR_LOG_PATH=/home/scripts/transmission/logs
TR_LOG_NAME=QUEUE_RULES
TR_EXEC_DATE=`date "+%Y%m%d%H%M%S"`
TR_LOG_FILE=${TR_LOG_PATH}/${TR_LOG_NAME}_${TR_EXEC_DATE}.log

echo "[`date '+%d-%m-%Y %H:%M:%S'`] Execution Started" >> ${TR_LOG_FILE}
echo "[`date '+%d-%m-%Y %H:%M:%S'`] Max Torrents in queue is set to ${TR_MAX_ACTIVE}" >> ${TR_LOG_FILE}

# Keep maximum torrents running
TORRENT_COUNT=0

TR_MIN_ACTIVE=`expr $TR_MAX_ACTIVE + 1`

PAUSED_COUNT=`transmission-remote -n ${TR_USER}:${TR_PASS} -l | sed '1d;$d' | tr " " "*" | cut -c58-64 | grep Stopped | wc -l`
TOTAL_COUNT=`transmission-remote -n ${TR_USER}:${TR_PASS} -l | sed '1d;$d' | wc -l`
ACTIVE_COUNT=`expr $TOTAL_COUNT - $PAUSED_COUNT`

echo "[`date '+%d-%m-%Y %H:%M:%S'`] Total Torrents: $TOTAL_COUNT" >> ${TR_LOG_FILE}
echo "[`date '+%d-%m-%Y %H:%M:%S'`] Pasued Torrents: $PAUSED_COUNT" >> ${TR_LOG_FILE}
echo "[`date '+%d-%m-%Y %H:%M:%S'`] Active Torrents: $ACTIVE_COUNT" >> ${TR_LOG_FILE}

cd /var/lib/transmission-daemon/info/torrents

        for TORRENT in `ls -lrth *.torrent | cut -c71- | tr " " "*"`; do
                TORRENT=`echo "$TORRENT" | tr "*" " "`
                TORRENT_NAME=`basename "${TORRENT}"`
                TORRENT_ID=`transmission-remote -n ${TR_USER}:${TR_PASS} -l | grep "${TORRENT_NAME%.*.torrent}" | cut -c1-4`
                TORRENT_COUNT=`expr $TORRENT_COUNT + 1`
                if [ "$TORRENT_COUNT" -gt "$TR_MAX_ACTIVE" ]
                then
                        echo "[`date '+%d-%m-%Y %H:%M:%S'`] Stopping Torrent: $TORRENT_NAME ..." >> ${TR_LOG_FILE}
                        transmission-remote -n ${TR_USER}:${TR_PASS} -t $TORRENT_ID -S
                fi

                if [ "$TORRENT_COUNT" -lt "$TR_MIN_ACTIVE" ]
                then
                        echo "[`date '+%d-%m-%Y %H:%M:%S'`] Starting Torrent: $TORRENT_NAME ..." >> ${TR_LOG_FILE}
                        transmission-remote -n ${TR_USER}:${TR_PASS} -t $TORRENT_ID -s
                fi
        done

echo "[`date '+%d-%m-%Y %H:%M:%S'`] No. of torrents pending in queue: `expr $TORRENT_COUNT - $TR_MAX_ACTIVE`" >> ${TR_LOG_FILE}
echo "[`date '+%d-%m-%Y %H:%M:%S'`] Execution Completed" >> ${TR_LOG_FILE}

} &


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: