Page 1 of 1
Post processing script howto?
Posted: May 20th, 2008, 9:46 am
by ferno
Hi,
I have been looking for info on how to write a post processing script but cant find anything.
Is there such a thing as an howto about this feature?
I have a bash script now that just loops and looks in the completed dir for series to copy to my NAS but it would be much nicer to use it as a post processing script.
I just do not know how, things like How is the info of the downloaded file passed to the script etc. are not clear to me.
Re: Post processing script howto?
Posted: May 23rd, 2008, 5:45 am
by ferno
THanx,
I searched for that page but did not find it.

Re: Post processing script howto?
Posted: May 27th, 2008, 5:14 am
by shypike
The SABnzbd distribution comes with a sample script called Sample-PostProc.sh
It is a trivial script, but it does tell you what the parameters do.
Of course we do not provide a script writing course. There's plenty of material
available on the Web on Unix scripting.
Re: Post processing script howto?
Posted: June 16th, 2008, 3:19 am
by ferno
shypike wrote:
Of course we do not provide a script writing course. There's plenty of material
available on the Web on Unix scripting.
No need for that, indeed plenty examples on the net and I can manage quite well when it comes to a Unix shell script (I even had one created which works preatty well already).
I just wanted to know how SABNZBD handles the output and input as well as the interaction with the script, It was silly of me not to think of the obvious $1, $2 etc. (or %1 etc. in dos scripts).
Re: Post processing script howto?
Posted: September 11th, 2008, 4:18 am
by ferno
Hi,
I kind of miss one variable her that would be nice to implement in the next version if possible.
The final unpacked files.
Like if you download a csi.01.02.nzb that after paring unraring etc. produces a csi.bla.bla.01.02.mkv it would be nice to have a $7 that shows csi.bla.bla.01.02.mkv when you do echo $7.
Maybe something for next release?
Re: Post processing script howto?
Posted: September 11th, 2008, 6:03 am
by shypike
This would work only for single file downloads, you'd be surprised how may jobs unpack dozens of files.
What's the use anyway? You already get the folder path, so $7 would contain the list
of files in that folder. It's not particularly difficult to get that list yourself.
Re: Post processing script howto?
Posted: September 11th, 2008, 7:09 am
by ferno
shypike wrote:
This would work only for single file downloads, you'd be surprised how may jobs unpack dozens of files.
What's the use anyway? You already get the folder path, so $7 would contain the list
of files in that folder. It's not particularly difficult to get that list yourself.
Hmm,
Guess so,
I am creating a script to copy the downloaded series to my NAS.
And using the file string I could use that.
But like you say I can also just do the mv *.* from the directory printed in the $1
Re: Post processing script howto?
Posted: September 11th, 2008, 11:00 am
by shypike
I'd use '*' and not '*.*'