Script and post-processing features

Want something added? Ask for it here.
Post Reply
Nevryn
Newbie
Newbie
Posts: 2
Joined: May 31st, 2012, 12:27 pm

Script and post-processing features

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

Re: Script and post-processing features

Post 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.
Nevryn
Newbie
Newbie
Posts: 2
Joined: May 31st, 2012, 12:27 pm

Re: Script and post-processing features

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