Page 1 of 1

Script and post-processing features

Posted: May 31st, 2012, 1:18 pm
by Nevryn
I have a script which scps a finished download to somewhere else then deletes the download and directory. However, the commands are of the form:

scp $directory/*
rm $directory/*

which works fine when there is just one file being copied/deleted but causes problems if there are multiple files from the same series being written to the directory. Whilst I'm sure that there are work arounds for this the easiest (from my point of view) is if the filename of the downloaded episode is passed to the script. I assume that there could be multiple files but they could be the parameters from 8 onwards.

Alternatively or additionally, in the Sorting section being able to apply different sorting rules to categories e.g. I'd like to sort stuff coming from Sickbeard differently than stuff added manually. Then I could get around the above problem by Sorting each download into a different directory and then there would never be more than one episode to copy or delete.

Re: Script and post-processing features

Posted: May 31st, 2012, 2:59 pm
by shypike
Why are you using the Sort function to write everything to a single folder?
Just have SABnzbd write the files to a folder per NZB.
After that you can just write a script with a loop that scp-s one file at the time.

Re: Script and post-processing features

Posted: June 1st, 2012, 11:02 am
by Nevryn
I'm not writing everything to a single folder. I'm writing all episodes of a show to a folder with the title of the show, as I expect most people do. Half of what I download is in a category where this is the behaviour I want. The other half is in another category where I'd very much like to be able to write to one folder per NZB but I don't see a way of getting SABnzbd to apply different sorting rules to different categories.