Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Remove finished torrent script (transmission)
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Remove finished torrent script (transmission)
25th Feb, 2015, 12:47 AM
Post: #1
Ragman Offline
Registered
Posts: 7
Joined: Feb 2015
Reputation: 0
Remove finished torrent script (transmission)
Fellow Xbianians,

I'm searching for a script that removes finished torrents from transmission. I came across some but they are for different devices.

script 1 (Click to View)
#!/bin/sh

# the folder to move completed downloads to

# port, username, password
SERVER="9091 --auth transmission:transmission"

# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
TORRENTLIST=`transmission-remote $SERVER --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=" " --fields=1`

transmission-remote $SERVER --list

# for each torrent in the list
for TORRENTID in $TORRENTLIST
do
echo Processing : $TORRENTID

# check if torrent download is completed
DL_COMPLETED=`transmission-remote $SERVER --torrent $TORRENTID --info | grep "Percent Done: 100%"`

# check torrents current state is
STATE_STOPPED=`transmission-remote $SERVER --torrent $TORRENTID --info | grep "State: Seeding\|Stopped\|Finished\|Idle"`
echo $STATE_STOPPED

# if the torrent is "Stopped", "Finished", or "Idle after downloading 100%"
if [ "$DL_COMPLETED" ] && [ "$STATE_STOPPED" ]; then
# move the files and remove the torrent from Transmission
echo "Torrent #$TORRENTID is completed"
echo "Removing torrent from list"
transmission-remote $SERVER --torrent $TORRENTID --remove
else
echo "Torrent #$TORRENTID is not completed. Ignoring."
fi
done
and this (Click to View)
#!/bin/bash
/usr/bin/transmission-remote 127.0.0.1:9091 -l | grep 100% | awk '{print $1}' | xargs -n 1 -I % /usr/bin/transmission-remote 127.0.0.1:9091 -t % -r
I was wondering if anyone got this to work on the xbian setup. I'm a bit o a linux & scripting noob just started digging in last week. it might be that "transmission-remote" doesn't get found in this? but what do i know...[/term]

I know your gonna say "just use rtorrent!" but i installed koper89's package and is doesn't communicate with SR or CP. I tried changing the socket stuff to ports, per directions in the thread, but this didn't help rutorrent just couldn't find rtorrent anymore.

If anyone has any directions on either one, it would be much apreciated.

Cheers,
Ragman
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015 12:47 AM
RE: Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015, 02:05 AM
RE: Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015, 03:22 AM
RE: Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015, 04:38 AM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 21st Jun, 2025, 04:55 PM Powered By MyBB, © 2002-2025 MyBB Group.