[UPHPU] Buffer output from exec call

Wade Preston Shearer groups at anavidesign.com
Thu Jun 10 10:33:58 MDT 2004


> Gentlemen (and I use the term loosely),

Don't forget to include our female members.

> I have a script that executes an rsync command on the backend to 
> propogate files to an FTP server.  The rsync command could take 
> several minutes to run depending on the number and size of files being 
> pushed.
>
> What I want to do is show a progress page to the end user while the 
> command is running that will refresh automatically.  Any ideas on the 
> best way to accomplish this?
>
> I had thought about something like this:
>
> Run the command from one page and background the process and redirect 
> the output to a file (rsync ... > /tmp/rsync.log 2>&1 &).   On a 
> subsequent page, just keep reading the contents of the rsync.log file 
> and display its contents while refreshing every 15 seconds or so.  
> Each time the page refreshes the output should get a little longer.
>
> One problem is how would I know the command had completed so I can 
> stop refreshing the page?
>
> Anyway, I'm a bit stumpx0r3d on this one.  Any insight is mucho 
> appreciado.

I cannot remember who it is at the moment, but there is an individual 
that I am fairly certain is subscribed to this list that has a project 
that has the functionality that you are looking for. They had put 
together a web-based chat client using PHP and javascript (if I 
remember correctly) that did not require the page to be refreshed. 
There were somehow "pushing" the content to the screen continuously I 
think.

My memory is vague about both the project and it's author. Hopefully, 
he or someone else will read this and can reply with more details.




More information about the UPHPU mailing list