scooter41 Posted April 3, 2008 Share Posted April 3, 2008 Hi There, I am building an application for a client that basically sends out SMS messages via a series of HTTP post requests to a 3rd party server. I am will be using curl to loop through the numbers (around 8000) or so, and can have the script continue even if the user closes down his browser using: ignore_user_abort(TRUE); However, what he would like to be able to do is stop the sending, and resume again another time if need be. The resuming isnt a challenge, I can easily do a counter on each sucesful send and make note of where to start/resume next time in the list. My question is, how would I go about accessing a script that is running in the background, if the user has left the page? Would I access it by a process ID or similar? Im using standard Plesk8 installation on Linux. Any help greatley appreciated, or even a direction on what to look for Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/99363-pause-resume-a-background-script/ Share on other sites More sharing options...
trq Posted April 3, 2008 Share Posted April 3, 2008 Would I access it by a process ID or similar? Yes. This really sounds like its going to be a challange to build a web interface too though. Quote Link to comment https://forums.phpfreaks.com/topic/99363-pause-resume-a-background-script/#findComment-508376 Share on other sites More sharing options...
scooter41 Posted April 3, 2008 Author Share Posted April 3, 2008 Initially I thought about outputing the html for each post, like: Sending 23 of 8000 - CLICK TO PAUSE Sending 24 of 8000 - CLICK TO PAUSE Sending 25 of 8000 - CLICK TO PAUSE But my concern would be if his connection was to time out, or perhaps was on a laptop and didnt have the power to leave it running in the browser Quote Link to comment https://forums.phpfreaks.com/topic/99363-pause-resume-a-background-script/#findComment-508383 Share on other sites More sharing options...
laffin Posted April 3, 2008 Share Posted April 3, 2008 have the script check for the existance of a file to abort operations. if it exists, remember to unlink the file before aborting. the creation of the file can be done thru another script. so ya want to have a read/write directory. Quote Link to comment https://forums.phpfreaks.com/topic/99363-pause-resume-a-background-script/#findComment-508384 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.