Post processing script howto?

Come up with a useful post-processing script? Share it here!
Post Reply
ferno
Jr. Member
Jr. Member
Posts: 52
Joined: March 19th, 2008, 5:49 pm

Post processing script howto?

Post 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.
ferno
Jr. Member
Jr. Member
Posts: 52
Joined: March 19th, 2008, 5:49 pm

Re: Post processing script howto?

Post by ferno »

THanx,
I searched for that page but did not find it.  :o
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Post processing script howto?

Post 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.
ferno
Jr. Member
Jr. Member
Posts: 52
Joined: March 19th, 2008, 5:49 pm

Re: Post processing script howto?

Post 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).
ferno
Jr. Member
Jr. Member
Posts: 52
Joined: March 19th, 2008, 5:49 pm

Re: Post processing script howto?

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

Re: Post processing script howto?

Post 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.
ferno
Jr. Member
Jr. Member
Posts: 52
Joined: March 19th, 2008, 5:49 pm

Re: Post processing script howto?

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

Re: Post processing script howto?

Post by shypike »

I'd use '*' and not '*.*'
Post Reply