in reply to how to keep tracking the system command in cgi

You can run a ps -ax command and grep for your command's name in the returned output. You could also, if you need intermediate results, write (or append) progress indicators to a log file and check that file's contents.

For example,

Read the file and RegEx for /Sx/. Some variant of this should help you. You could also use a SHM drop-box or other in-memory variant.

Don Wilde
"There's more than one level to any answer."