Instead of writing a static file obtained using AJAX or in an additional database field, why not create another PHP script that simply returns the percentage of completion for the specified task. Then your page can update the progress with a very easy AJAX request to the specified PHP script.
"" script, , , " ". , "" script . , , .
UPDATE
" " script, . , .
script, , (script, ), ( , , , , , , script, ) . , 1. " ", script, . , . . , . , , . ( ), , , script. , , , .