in reply to How to run a perl script from a cgi page and track its status ?

Super Search is your friend. Managing a long running server side process using CGI, Web Browser File Upload Progress Bar in Perl w/AJAX, CGI progress indicator, how to add progress bar to the CGI script
  • Comment on Re: How to run a perl script from a cgi page and track its status ?

Replies are listed 'Best First'.
Re^2: How to run a perl script from a cgi page and track its status ?
by chidori (Novice) on Sep 18, 2014 at 15:44 UTC

    Ok , I am planning to go with system command , will send the command to background and also redirect the the output to log like shown below.

    system(myscript >myoutput.log 2>&1 &)

    This way , I am able to send it to background and it does seems to be running. I am planning to use ps -ef | grep myoutput.log to grep the pid and then search for the pid at regular interval to trace its status. Can someone out there let me know if this sounds logical or possibly suggest me a better way please.