Page 1 of 1

Issues with transmission script

Posted: Tue Oct 02, 2012 11:17 am
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

Re: Issues with transmission script

Posted: Sat Oct 06, 2012 8:49 pm
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?