I have a bash script that can take hours to finish.
I have a web frontend for it to make it easy to use.
On this main page, I wanna have a url that I press that starts my php command
<?exec('myscript that take a long time');?>
After the exec has finished, I want it to load a cookie.
setcookie('status',"done");
This is all easily done and works as is. However, the url that loads my exec command is a blank white page. I dont want this. I want the url to be an action which starts my phpscript and sets the cookie when the exec command returns all in the background.
Is this possible?
If not, how close can I get to this behavior.
EDIT:
function foo(){
var conn = new Ext.data.Connection();
conn.request({
url:‘request.php’,
method:‘POST’,
success: function(responseObject) {
alert(“Hello,Word!”);
},
failure: function() {
alert(“Something fail”);
}
});}
I have tried the above code with no luck.
exec('nohup myscript that take a long time &')and afterwardssetcookie()