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 2013.05.24

Post by killemov »

Well, you might want to put your file names in quotes.

Code: Select all

cp -R "$SRC_DIR" "$DEST_DIR"
Khabel
Posts: 5
Joined: Wed Jul 04, 2012 10:00 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by Khabel »

killemov wrote:Well, you might want to put your file names in quotes.

Code: Select all

cp -R "$SRC_DIR" "$DEST_DIR"
Tried that as well, makes no difference. If I use a hard coded variable for the destination with no spaces it works fine
Scouzer
Posts: 7
Joined: Wed Jan 08, 2014 9:32 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by Scouzer »

I have tried the script from the first post on page 1 on my Readynas ultra 2.
But I can't get it to work.
So I have tried to run the script manually by using bash posttorrent.sh, but I get this error:

: command not founde 3: {
: command not founde 18:
'osttorrent.sh: line 38: syntax error near unexpected token `do
posttorrent.sh: line 38: ` for RAR_FILE in $( find "$SRC_DIR" -type f -inam' "*.rar" ); do

All I have done to the script is changing the TR_USERNAME and TR_PASSWORD and also change it to $TR_TORRENT_HASH --remove at the end of the script.

Some one can help me with what I am doing wrong.
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

Scouzer wrote:Some one can help me with what I am doing wrong.
As i posted in viewtopic.php?f=3&t=15584:
killemov wrote:I don't know if you can run this script on a vanilla ReadyNAS Ultra 2 anyway. See the prerequisites in the first post of the aforementioned thread.
This script was written for Debian. Sure it will work on many other Linux distributions. But especially for limited operating systems (NAS,router, ...) there is the possibility it will not work.
Scouzer
Posts: 7
Joined: Wed Jan 08, 2014 9:32 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by Scouzer »

my Readynas ultra 2 is running Debian etch
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

Scouzer wrote:... I get this error:

: command not founde 3: {
: command not founde 18:
'osttorrent.sh: line 38: syntax error near unexpected token `do
posttorrent.sh: line 38: ` for RAR_FILE in $( find "$SRC_DIR" -type f -inam' "*.rar" ); do
...
I guess your version of bash is too old to be able to parse these expressions.
Scouzer
Posts: 7
Joined: Wed Jan 08, 2014 9:32 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by Scouzer »

Anything I can do about that?
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

Scouzer wrote:Anything I can do about that?
Sigh, although this has nothing to do with the unrar script and everything with your OS:
Your safest bet would be to only upgrade the bash package. (apt-get update, apt-get install bash) This may prove impossible as Debian Etch was declared End-Of-Life almost four years ago. If so, then you need to take your quest to the readynas/debian forums. Good luck!
mike.dld
Transmission Developer
Posts: 306
Joined: Wed Dec 25, 2013 10:56 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by mike.dld »

Or one could rewrite the script so it supports even that "old" bash (or even other less popular shells). Just saying. Although I could spend some time on this if you wish.
Merwenus
Posts: 13
Joined: Wed Jan 29, 2014 1:01 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by Merwenus »

Hello,
I have 2 questions, How can I make the new (2013 may) script to extract ZIP archives, and the other when I have only flt-reme.001->flt-reme.066 files but no r01, or rar, how can I force it to extract these too?
Thank you!
vmi
Posts: 2
Joined: Tue Feb 11, 2014 10:25 am

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by vmi »

dtrx is a great tool for handling extraction from various archives.
Merwenus
Posts: 13
Joined: Wed Jan 29, 2014 1:01 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by Merwenus »

vmi wrote:dtrx is a great tool for handling extraction from various archives.
Torrentexpander sorted it out, works better than this, ty btw.
dwardo
Posts: 2
Joined: Sun Mar 09, 2014 8:47 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by dwardo »

Hello,

I have added this script to my box and it doesn't extract any rar's. When I run the script manually I get the following error:

host:/addons-config/Transmission# bash posttorrent
posttorrent: line 28: conditional binary operator expected
posttorrent: line 28: syntax error near `=~'
posttorrent: line 28: ` if [[ "$TR_TORRENT_PARAMETER" =~ "EXIT" ]]; then'

Any help would be appreciated.
dwardo
Posts: 2
Joined: Sun Mar 09, 2014 8:47 pm

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by dwardo »

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

Re: Unrar and cleanup script - UPDATE 2013.05.24

Post by killemov »

I guess you do need a newer version of busybox.
Post Reply