in reply to how to call system commands from cgi file?
Also see Watching long processes through CGI and maybe the discussions in Managing a long running server side process using CGI and Update on controlling long-running processes via CGI.