Unrar and cleanup script - UPDATE 2013.05.24

Discussion of Transmission that doesn't fit in the other categories
dwardo
Posts: 2
Joined: Sun Mar 09, 2014 8:47 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by dwardo » Sun Mar 09, 2014 11:58 pm

It appears that I may not have the required version of bash, and may not be able to upgrade it. I am running transmission on my Readynas NV+ firwmare 4.1.13:

host :/addons-config/Transmission# bash --version
GNU bash, version 2.05b.0(1)-release (sparc-unknown-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.

Can anybody suggest an alternative to "=~" in the script for me?

Thanks

killemov
Posts: 421
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov » Thu Apr 09, 2015 5:50 am

I guess you do need a newer version of busybox.

hahaha
Posts: 3
Joined: Fri May 08, 2015 12:06 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by hahaha » Fri May 08, 2015 12:10 am

Hi Killemov,
Thanks for the script, haven't implemented it yet but it seems nice.
quick one I hope, if I wanted a longer sleep time, should I modify this line and put xxh instead of 1h ?

TR_TORRENT_PARAMETER="EXTRACT SLEEP1h"

Also, where in the script would you put a command that you want executed for every torrent (in that case trigger a library update on a remote xbmc) after the extract but before the sleep ?

killemov
Posts: 421
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov » Fri May 08, 2015 5:27 am

hahaha wrote:Hi Killemov,
Thanks for the script, haven't implemented it yet but it seems nice.
quick one I hope, if I wanted a longer sleep time, should I modify this line and put xxh instead of 1h ?

TR_TORRENT_PARAMETER="EXTRACT SLEEP1h"

Also, where in the script would you put a command that you want executed for every torrent (in that case trigger a library update on a remote xbmc) after the extract but before the sleep ?
TR_TORRENT_PARAMETER="EXTRACT SLEEP2h"

And yes, but that would work for rar archives only. All other file types would be ignored anyway.

hahaha
Posts: 3
Joined: Fri May 08, 2015 12:06 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by hahaha » Fri May 08, 2015 7:59 pm

Hey thanks for the advice

I'm trying to implement the script and running into a weird behaviour:
I ran a torrent with a ssh open on the server, and I get a lot of output in the console:

first a lot of these, all over the place, not only in the download folder
find: `/var/log/gdm3': Permission denied
Then extracting a random rar file, still not in the same folder:
Extracting from /mnt/raid5-6to/Films/.../random_rar_file.rar
the extracting fails, and then:
./posttorrent.sh: line 53: /var/log/posttorrent.log: Permission denied
then there is a transmission-remote call with invalid options that displays the man
and finally:
No torrent specified! Please use the -t option first.
localhost:9091/transmission/rpc/ responded: "success"
No torrent specified! Please use the -t option first.
localhost:9091/transmission/rpc/ responded: "success"

So the underlying issue seems to be permissions but not sure why the script would try to extract random stuff.
I used the 1st page script and modified username, password, DEST_DIR="$SRC_DIR", and commented the --remove-and-delete line, that's all

Any advice ?

hahaha
Posts: 3
Joined: Fri May 08, 2015 12:06 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by hahaha » Sun May 10, 2015 11:54 am

Hi,
On an update on my troubles, I think I identified the cause:
It seems the transmission environment variables are not set.
Additionally it seems weird that the output of the script shows up in my open console, and it would make sense that in my console the variables are not set. Do you have an idea of why it is behaving that way ?

Thanks

killemov
Posts: 421
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov » Sat Mar 26, 2016 2:15 pm

Note that the script will be executed by the same user that runs the transmission daemon. And that implies running all the commands in the script for the same user as well.

aspoels
Posts: 3
Joined: Fri Feb 01, 2019 5:46 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by aspoels » Thu Feb 07, 2019 6:13 pm

Im having trouble getting this to work for me on ubuntu 18 with transmission 2.92..... also- is there a way to have the script unpack the files right into the preexisting torrent folder with the rar files?

killemov
Posts: 421
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov » Fri Feb 08, 2019 12:46 am

That is what's supposed to happen. If you echo the values from these variables (TR_TORRENT_DIR and TR_TORRENT_NAME) you might get an idea of what is going wrong.

rishioo7
Posts: 1
Joined: Fri Sep 11, 2020 11:36 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by rishioo7 » Fri Sep 11, 2020 12:02 pm

Alright, this recommends the content is, in any event, ready to run on your framework and that unrar is called. The difficulty despite everything is that the content isn't called from the transmission. In the event that you have (triple!)checked for the legitimate setup of the settings.json document and the content is in the right spot with the right name ("feline/mnt/information/Torrents/extract.sh" shows the substance of the content), at that point I'm out of thoughts.

Post Reply