if i write a script in php will it work? I don't understand the exit code stuff,
how does sabnzbd pick it up once php is done?
if i write a php script can it work?
Re: if i write a php script can it work?
Any program run by SABnzbd returns some exit code.
Currently this code is ignored, but a future release will handle it.
Whether or not a return code from a PHP script will reach SABnzbd,
depends on whether the PHP program will handle it properly.
I don't know which platform you use, but on Linux/Unix
scripts begin with the shebang #!/bin/php and then such things
as exit codes are taken care of.
Currently this code is ignored, but a future release will handle it.
Whether or not a return code from a PHP script will reach SABnzbd,
depends on whether the PHP program will handle it properly.
I don't know which platform you use, but on Linux/Unix
scripts begin with the shebang #!/bin/php and then such things
as exit codes are taken care of.
Re: if i write a php script can it work?
i wrote a script that works on my windows xp pc in php.
It works for the directory its in, since this directory is also passed in during the commandline
Im not entirely sure what path sabnzbd passes in, the "completed" directory or the directory
of the actually downloaded file. Maybe this is not being passed in correctly to the script.
How do i paste the code into these forums. when i tried i get post to /index.php not allowed.
I tried putting it in between the code tags but i still get the same error.
It works for the directory its in, since this directory is also passed in during the commandline
Im not entirely sure what path sabnzbd passes in, the "completed" directory or the directory
of the actually downloaded file. Maybe this is not being passed in correctly to the script.
How do i paste the code into these forums. when i tried i get post to /index.php not allowed.
I tried putting it in between the code tags but i still get the same error.
Re: if i write a php script can it work?
The security module of the forum is very panicky about code.
As we're not going to debug your script, there's no need to post it
If you want to see what parameters you get, just let SABnzbd run the
Sample-PostProc.cmd for a download job.
It will show you what the parameters are.
As we're not going to debug your script, there's no need to post it
If you want to see what parameters you get, just let SABnzbd run the
Sample-PostProc.cmd for a download job.
It will show you what the parameters are.
Re: if i write a php script can it work?
Ah ok. I understand, i wouldn't want code being injected in my forums also
I was just hoping to share the script with others.
Basically I made a script that uses 7z. It can be recursive or non recursive.
Depends on certain code i have included, if you comment and uncomment certain
things it switches, although, i was thinking of making two functions, one for each.
For timesake i put it all in one function for now.
Well, I think it works so far, im going to run that sample script you mentioned and
i guess once i get the directories passed in and get that exit code working with sab
it'll be good.
Im still not sure how that exit code works unfortunately
if at the end of my php code, i run "exit(0)"; if all goes fine
will sabnzbd pick that up or is it something else i have to write sorry.
Sorry for asking so much, i just don't get it .
Thanx for the help though. Again i wasn't trying to hack the forums,
I just wanted to share it with others and maybe even get improvements done.
Maybe i can attach it as a .txt file? I'll try later.
I was just hoping to share the script with others.
Basically I made a script that uses 7z. It can be recursive or non recursive.
Depends on certain code i have included, if you comment and uncomment certain
things it switches, although, i was thinking of making two functions, one for each.
For timesake i put it all in one function for now.
Well, I think it works so far, im going to run that sample script you mentioned and
i guess once i get the directories passed in and get that exit code working with sab
it'll be good.
Im still not sure how that exit code works unfortunately
if at the end of my php code, i run "exit(0)"; if all goes fine
will sabnzbd pick that up or is it something else i have to write sorry.
Sorry for asking so much, i just don't get it .
Thanx for the help though. Again i wasn't trying to hack the forums,
I just wanted to share it with others and maybe even get improvements done.
Maybe i can attach it as a .txt file? I'll try later.
Re: if i write a php script can it work?
Attaching the script as a txt file should work, or submit it to the various paste sites such as pastebin.com and pastebin.ca
Re: if i write a php script can it work?
That's the right way, but the current releases of SABnzbd will ignore the code.soudlous wrote: if at the end of my php code, i run "exit(0)"; if all goes fine
will sabnzbd pick that up or is it something else i have to write sorry.
Sorry for asking so much, i just don't get it .
We'll change that later.
Also, the script runs at the very end of post-processing, so there's not very
much that SABnzbd can do with the exit code, but we will show it in the
history in a later release.