Unrar and cleanup script - UPDATE 2013.05.24

Discussion of Transmission that doesn't fit in the other categories
hahaha
Posts: 3
Joined: Fri May 08, 2015 12:06 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by hahaha »

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: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

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 »

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 »

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: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

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 »

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: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

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 »

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