Unrar and cleanup script - UPDATE 2013.05.24

Discussion of Transmission that doesn't fit in the other categories
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2011.10.24

Post by killemov »

Hey globalrebel, the added statements (an mkdir and a cd) have nothing to do with where the resulting files will end up. You have to assign a new path to DEST_DIR for that.

Good luck with that ...
ZaPHoN
Posts: 9
Joined: Sun Aug 19, 2012 5:54 pm

Re: Unrar and cleanup script - UPDATE 2011.10.24

Post by ZaPHoN »

How would I add "remove in x days (or seconds)" to this script?
Could someone assist please.
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2011.10.24

Post by killemov »

ZaPHoN wrote:How would I add "remove in x days (or seconds)" to this script?
Could someone assist please.
A delay of 1 hour before removing the torrent is in there already using the sleep command. Please read the manual page for sleep. Oh, and make sure transmission is not restarted during the sleep period because you might end up removing an unrelated torrent.
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Unrar and cleanup script - UPDATE 2013.01.10

Post by killemov »

Changelog
  • Use TR_TORRENT_HASH instead of TR_TORRENT_ID for referencing torrents. This will ensure the proper torrent is deleted after a restart of the daemon.
ccomly
Posts: 2
Joined: Wed Jan 16, 2013 6:26 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by ccomly »

I would love a simplified remove when seed complete, "Finished". (just the torrent not the data)
trying to figure out how to do this.

transmission-remote -n user:password -l | grep Finished
will list the current finished seeded torrents.

how do i issue

transmission-remote -n user:password -r "Name of torrent without .torrent"

with the result of the first command input'ed correctly into the "Name of torrent without .torrent"
or if there is a simpler way to do it. Thanks.
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by blacke4dawn »

ccomly wrote:I would love a simplified remove when seed complete, "Finished". (just the torrent not the data)
trying to figure out how to do this.

transmission-remote -n user:password -l | grep Finished
will list the current finished seeded torrents.

how do i issue

transmission-remote -n user:password -r "Name of torrent without .torrent"

with the result of the first command input'ed correctly into the "Name of torrent without .torrent"
or if there is a simpler way to do it. Thanks.
Quick and crude way, someone could probably improve it a bit:

Code: Select all

transmission-remote -n user:pw -l | grep Finished | awk '{ print $1 }' | xargs -I '{}' transmission-remote -n user:pw -t'{}' -r
ccomly
Posts: 2
Joined: Wed Jan 16, 2013 6:26 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by ccomly »

blacke4dawn wrote:
ccomly wrote:I would love a simplified remove when seed complete, "Finished". (just the torrent not the data)
trying to figure out how to do this.

transmission-remote -n user:password -l | grep Finished
will list the current finished seeded torrents.

how do i issue

transmission-remote -n user:password -r "Name of torrent without .torrent"

with the result of the first command input'ed correctly into the "Name of torrent without .torrent"
or if there is a simpler way to do it. Thanks.
Quick and crude way, someone could probably improve it a bit:

Code: Select all

transmission-remote -n user:pw -l | grep Finished | awk '{ print $1 }' | xargs -I '{}' transmission-remote -n user:pw -t'{}' -r
thanks a bunch seems to work, also thanks for pointing to xargs and awk.
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by killemov »

@cconly, blacke4dawn:
Your solutions have nothing to do with the unrar-and-cleanup script, which runs when a torrent is complete.

In the script there's is the line:

Code: Select all

          transmission-remote -n $TR_USERNAME:$TR_PASSWORD -t $TR_TORRENT_HASH --remove-and-delete
Why not just replace that with:

Code: Select all

          transmission-remote -n $TR_USERNAME:$TR_PASSWORD -t $TR_TORRENT_HASH --remove
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by blacke4dawn »

killemov wrote:@cconly, blacke4dawn:
Your solutions have nothing to do with the unrar-and-cleanup script, which runs when a torrent is complete.

In the script there's is the line:

Code: Select all

          transmission-remote -n $TR_USERNAME:$TR_PASSWORD -t $TR_TORRENT_HASH --remove-and-delete
Why not just replace that with:

Code: Select all

          transmission-remote -n $TR_USERNAME:$TR_PASSWORD -t $TR_TORRENT_HASH --remove
The way he worded it sounded like he wanted them removed when they where done seeding and not "just" done downloading.
dochyde
Posts: 3
Joined: Thu Mar 14, 2013 4:10 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by dochyde »

I get this error I do not understand why?
Haven't touched the script except edit the log location.

Code: Select all

posttorrent.sh: line 19: syntax error near unexpected token `then'
posttorrent.sh: line 19: `  if [ -e "$SRC_DIR/keep" ]; then'
Anybody knows what's wrong?
dochyde
Posts: 3
Joined: Thu Mar 14, 2013 4:10 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by dochyde »

I think I found my pb, it's the copy/paste.
I don't understand why people don't simply post the file itself as c/p has so much issues.

I am using SELECT ALL and right click and selecting copy.
Then I go on my Linux terminal using nano and just paste...and apparently there are some bad caracters in the script. :/

Can someone please post the script in a file please.
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by killemov »

Tried it again myself and ... It's just your fingers being twitchy. :evil:
dochyde
Posts: 3
Joined: Thu Mar 14, 2013 4:10 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by dochyde »

I have not managed to c/p it either with nano or vi without getting errors.

to bad for me I guess.

Thanks for your time. ;)
GAPP
Posts: 2
Joined: Mon Mar 25, 2013 11:37 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by GAPP »

Hello,

Script looks really good, but since I'm such a newbie at this I'm a little afraid to implement it before I know a few things.

Can you toggle it, so it doesnt actually delete the rarfiles after the extracting is done? I use a FTP ratio community, so they would get really angry if someone just downloaded the files and delete it right after.

Also, will it extract it in the same folder as the rars are in?

Lastly, I'm using ReadyNAS Ultra 2, I assume it works with it?
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.01.10

Post by killemov »

GAPP wrote:Hello,

Script looks really good, but since I'm such a newbie at this I'm a little afraid to implement it before I know a few things.
Yeah, I just finished slapping some lipstick on her. :wink:
Can you toggle it, so it doesn't actually delete the rarfiles after the extracting is done? I use a FTP ratio community, so they would get really angry if someone just downloaded the files and delete it right after.
Sure, just give me your account data and I will edit it for you. (Or put a file named "keep" in the top folder of your torrent. Or find "--remove-and-delete" in the script and replace it with "--remove".)
Also, will it extract it in the same folder as the rars are in?
No, but DEST_DIR="$SRC_DIR" might do the trick.
Lastly, I'm using ReadyNAS Ultra 2, I assume it works with it?
You haven't read the first post or you you have a hard time understanding it, right? But wouldn't that make your initial compliment just a bit ... insincere?

In short: @alln00bs: You need to find some things out for yourselves!
Post Reply