Page 7 of 10

Re: Unrar and cleanup script - UPDATE 2011.10.24

Posted: Thu Sep 13, 2012 7:51 pm
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 ...

Re: Unrar and cleanup script - UPDATE 2011.10.24

Posted: Tue Sep 18, 2012 7:20 pm
by ZaPHoN
How would I add "remove in x days (or seconds)" to this script?
Could someone assist please.

Re: Unrar and cleanup script - UPDATE 2011.10.24

Posted: Sat Sep 22, 2012 9:40 am
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.

Unrar and cleanup script - UPDATE 2013.01.10

Posted: Thu Jan 10, 2013 2:17 pm
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.

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Wed Jan 16, 2013 7:13 pm
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.

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Wed Jan 16, 2013 8:54 pm
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

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Wed Jan 16, 2013 11:46 pm
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.

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Thu Feb 28, 2013 8:38 am
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

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Sat Mar 02, 2013 8:37 am
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.

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Thu Mar 14, 2013 4:13 pm
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?

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Thu Mar 14, 2013 4:21 pm
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.

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Thu Mar 14, 2013 8:54 pm
by killemov
Tried it again myself and ... It's just your fingers being twitchy. :evil:

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Thu Mar 14, 2013 9:22 pm
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. ;)

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Mon Mar 25, 2013 11:47 pm
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?

Re: Unrar and cleanup script - UPDATE 2013.01.10

Posted: Wed Mar 27, 2013 7:49 pm
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!