Help with Categories question...

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
rmprest
Newbie
Newbie
Posts: 5
Joined: January 1st, 2012, 11:33 am

Help with Categories question...

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Help with Categories question...

Post 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?
rmprest
Newbie
Newbie
Posts: 5
Joined: January 1st, 2012, 11:33 am

Re: Help with Categories question...

Post 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 !
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Help with Categories question...

Post 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?
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Help with Categories question...

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
rmprest
Newbie
Newbie
Posts: 5
Joined: January 1st, 2012, 11:33 am

Re: Help with Categories question...

Post 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?
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Help with Categories question...

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
rmprest
Newbie
Newbie
Posts: 5
Joined: January 1st, 2012, 11:33 am

Re: Help with Categories question...

Post 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 ?
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Help with Categories question...

Post by safihre »

I think this should be:
network="/mnt/Video/Movies/";
(so with the extra / at the end)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
rmprest
Newbie
Newbie
Posts: 5
Joined: January 1st, 2012, 11:33 am

Re: Help with Categories question...

Post 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!
Post Reply