Page 1 of 1

Help with Categories question...

Posted: January 27th, 2016, 7:38 am
by rmprest
Hi everyone,

Long time lurker, first time poster.

I'm struggling to understand some strange behaviour and I'm sure the answer is a simple one but I've read all the guides and similar threads and can't work it out so I'm admitting defeat and creating a thread for help.

All I'm trying to do is move completed movie downloads to a synology nas - I thought to do this all I needed to do was download and process the file on my local machine as normal and then add the network drive path into the folder/path field in the categories section to move it there.

My problem is when I put the path there the file then starts to unpack on the nas itself rather than the local machine and that takes an age to complete (old nas which is why I prefer to do the processing locally)

Where am I going wrong here ? Is the folder/path field the simplest way to do this ?

Cheers

Rmprest

Re: Help with Categories question...

Posted: January 27th, 2016, 9:15 am
by shypike
It unpacks from the RAR files on the local machines to the NAS.
That should be the most efficient solution.
Unfortunately, it seems that unrar is rather inefficient when dealing
with networked destination drives.
We may try to tackle this in the future, but hopefully unrar will be fixed sooner.
On which operating system do you run SABnzbd?

Re: Help with Categories question...

Posted: January 28th, 2016, 4:55 am
by rmprest
Hi shypike,

Thanks for the reply - I understand the bevaviour now thanks for the explanation.

I'm using a Mac Mini as my local machine btw

So it looks like a script will be required... something I am struggling to get working. I have used code from various topics on the forum which I thought would work but not yet.. I must be missing something simple !

Essentially I want to move completed files from Users/admin/NZB Downloads to mnt/Video/Movies but when I run the following script:

Code: Select all

#!/bin/bash
local="/Users/admin/NZB Downloads/“;
network=“/mnt/Video/Movies“;
for folders in "$1" #### for all folders inside the downloadpath do the following
do
newpath=$(echo "$folders" | sed "s#$local#$network#g") #### create new path by replacing local dirs with networkdir
mkdir -p "$newpath" #### make the newdir if it doesn't exist
cp -TRf "$folders" "$newpath"  #### copy all files and folders inside the downloadpath 
#rm -Rf "$folders" #### delete sourcefolder
done

I get this error message in sab

/Users/admin/Sick-Beard/autoProcessTV/movie: line 9: unexpected EOF while looking for matching `"'
/Users/admin/Sick-Beard/autoProcessTV/movie: line 11: syntax error: unexpected end of file


Any help would be much appreciated !

Re: Help with Categories question...

Posted: January 28th, 2016, 6:00 am
by shypike
Where do you run the script?
It looks like you're running SickBeard also.
Why don't you let SickBeard take care of moving the end result of a job to the NAS?

Re: Help with Categories question...

Posted: January 28th, 2016, 6:14 am
by safihre
You have errors in your quotations, " is not the same as “. That's probably why it fails.
Make them all "

Sickbeard will only do TV, not Movies.

Re: Help with Categories question...

Posted: January 28th, 2016, 6:22 am
by rmprest
Thanks for the tip safihre (and shypike!)

Made sure everything is correct with the "

Code: Select all

#!/bin/bash
local="/Users/admin/NZB Downloads/";
network="/mnt/Video/Movies";
for folders in "$1" #### for all folders inside the downloadpath do the following
do
newpath=$(echo "$folders" | sed "s#$local#$network#g") #### create new path by replacing local dirs with networkdir
mkdir -p "$newpath" #### make the newdir if it doesn't exist
cp -TRf "$folders" "$newpath"  #### copy all files and folders inside the downloadpath 
#rm -Rf "$folders" #### delete sourcefolder
done

And now i'm seeing the following error message in Sab once script kicks in and attempts the move

cp: illegal option -- T
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory


Sorry im such a noob, can anyone see where im going wrong here?

Re: Help with Categories question...

Posted: January 28th, 2016, 6:43 am
by safihre
Your CP doesn't know the -T command, so just make it:

cp -Rf "$folders" "$newpath" #### copy all files and folders inside the downloadpath

But in that error description it also doesn't show the -f parameter (force parameter), so you might have to remove that one as well.

Re: Help with Categories question...

Posted: January 28th, 2016, 7:06 am
by rmprest
Ok this is much better.. The file now pushes over to the NAS !

safihre you are the best

One small problem remains..

The file copies into the Video folder on the Nas but instead of putting it into the Movie folder the folder stays on the Video level and creates a folder like 'MoviesJurrassic Park' and within that folder is Jurassic Park (as an example)... What am i missing ?

Re: Help with Categories question...

Posted: January 28th, 2016, 8:02 am
by safihre
I think this should be:
network="/mnt/Video/Movies/";
(so with the extra / at the end)

Re: Help with Categories question...

Posted: January 28th, 2016, 9:03 am
by rmprest
Ah yes just spotted that.. Ok tried again and got another error then spotted a rouge "

Once fixed, its working :-)

Huge thanks for your assistance safihre and skypike, i can now stop ripping out my hair plus i've learnt some (very) basic new skills

Cheers!