Issues with transmission script

Discussion of Transmission that doesn't fit in the other categories
Post Reply
springs
Posts: 6
Joined: Tue Oct 02, 2012 11:12 am

Issues with transmission script

Post by springs »

Hi All,

I'm using the below script to move completed torrents to another directory and then remove from transmission.

The script removes the torrents but isn't removing them. Is anyone able to tell me if there is a problem with the script?

Code: Select all

MOVEDIR=/disk4/done
TORRENTLIST=`transmission-remote --auth=user:password --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=' ' --fields=1`

for TORRENTID in $TORRENTLIST
do
echo "* * * * * Operations on torrent ID $TORRENTID starting. * * * * *"

DL_COMPLETED=`transmission-remote --auth=user:password --torrent $TORRENTID --info | grep "Percent Done: 100%"`
STATE_STOPPED=`transmission-remote --auth=user:password --torrent $TORRENTID --info | grep "State: Stopped\|Finished\|Idle"`
if [ "$DL_COMPLETED" != "" ] && [ "$STATE_STOPPED" != "" ]; then
echo "Torrent #$TORRENTID is completed."
echo "Moving downloaded file(s) to $MOVEDIR."
transmission-remote --auth=user:password --torrent $TORRENTID --move $MOVEDIR
echo "Removing torrent from list."
transmission-remote --auth=user:password --torrent $TORRENTID --remove
else
echo "Torrent #$TORRENTID is not completed. Ignoring."
fi
echo "* * * * * Operations on torrent ID $TORRENTID completed. * * * * *"
done
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: Issues with transmission script

Post by blacke4dawn »

Looking it over doesn't present anything as wrong, and I take you mean it moves then but not remove them afterwards.

A few questions though, why not use the incomplete-dir and torrent-done-script features?
Post Reply