Solved

Process list with PHP

Posted on 2006-11-22
4
394 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
4 Comments
 
LVL 3

Accepted Solution

by:
nishayr earned 125 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
linearIn  challenge 23 65
copyEndy  challenge 15 55
changeXy challenge 13 57
Re-position the objects 7 49
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now