Check up the status of a Script (running or not)

Hello,

i allready search on google und here in the local Forum, but can't found something.

I need a query in php, that check whether a process (script) is running or not. Like this:

php query: /usr/bin/Script01 >> if runnig, then: "Script01 is Online", if not "Script01 is Offline"

I am grateful of any help..

Best regards.

You can "ps -ef|grep 'script_name', or pgrep 'script_name', or fuser the script file. Scripts without a #! line or not executable may be run to stdin of sh, so the first two can fail. See man execvp Man Page for execvp (linux Section 3) - The UNIX and Linux Forums, execve: Man Page for execve (linux Section 2) - The UNIX and Linux Forums

Thanks, i got allready the solution