Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Process list with PHP

Posted on 2006-11-22
4
Medium Priority
?
439 Views
Last Modified: 2008-03-06
Hello there,

I have a php script calling a perl script with exec("/home/*/script.pl &");
Since this php script is frequently accessed, and the pl script executes slow processes, I need to know if the script.pl is running, so I can choose between run it again or not. Is there any way that a php script could have access to linux process list, or, even better, just check wheter a pl script is running or not?

Thanks
0
Comment
Question by:mafosil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
nishayr earned 500 total points
ID: 17995486
Hey there,

Maybe have the script create a '.scriptlockfile' or something when it starts, and remove that file when completing.

When the script starts, it can check for the existence of this file, and exit if the file exists and create the file and continue processing if the file is not there...

Thanks,
Nish
0
 

Author Comment

by:mafosil
ID: 18007567
I have it as my backup solution, but what I really want is a solution that I dont need to do this kind of 'trick' thou that's what I'll do if nothing comes up.

Thanks :)

Marcelo Silveira
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question