Issues with transmission script
Posted: Tue Oct 02, 2012 11:17 am
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?
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