Re: [PHP] Send process to background



Here's what I'm trying to do.

There is a script that is called through a web request. That same
script is responsible for backing up a whole site (and database) to
..tar.gz files.

Evidently, this will take a while. My first requirement was that it
should _NOT_ deppend on external libraries (ie. pecl, modules and
such). It has to be self-sustained. As such, it will take a bit longer
to execute.

All I need is a way to send a function to background, and to finish
the request telling the user that the backup is being made. At that
time, it should continue executing the backup untill it has been
completed. If I can manage to do this, I will be able to make an
application that pools the same page (it will store a status) to know
if it's doing anything, if it has finished, if an error ocurred, or if
the backup can be downloaded to our fileservers.

Thanks.

On 10/13/06, Paul Scott <pscott@xxxxxxxxx> wrote:

On Fri, 2006-10-13 at 16:05 +0000, André Medeiros wrote:

> The thing is, the first request to the site needs to start the backup,
> but I didn't want to use any command-line tools, since some of our
> servers rely on safe_mode. Is there any way to send output to the
> browser on this first instance, finish the request, but keeping the
> PHP running and making the backup.

Take a look at this class that I wrote a while back. It does what you
need.

http://www.phpclasses.org/browse/package/2837.html

--Paul



All Email originating from UWC is covered by disclaimer http://www.uwc.ac..za/portal/uwc2006/content/mail_disclaimer/index.htm



.



Relevant Pages

  • Re: How to set Timeout with URL Moniker?
    ... > We use a URL Moniker to make an HTTP/S request to a script which can ... > take sometimes several minutes to execute. ... I've tested and our script executes successfully and returns ...
    (microsoft.public.vc.language)
  • Re: Cant configure backup...
    ... Oh well, the Backup works now, and when I finish getting a fresh backup done ... current web request. ... Exception Details: System.UnauthorizedAccessException: Access to the path ... context) +85 ...
    (microsoft.public.windows.server.sbs)
  • Cant configure backup...
    ... I needed to alter our backup settings to save fewer backups due to space ... verification using username/password. ... though with a different error (available on request.) Is it ... context) +85 ...
    (microsoft.public.windows.server.sbs)
  • RE: [PHP] Send process to background
    ... There is a script that is called through a web request. ... the request telling the user that the backup is being made. ... PHP running and making the backup. ...
    (php.general)
  • Re: 0x8007045d error
    ... This post talks about backup. ... Request could not be performed: I/O device error 0X8007045D ... Networking, Internet, Routing, VPN Troubleshooting on ...
    (microsoft.public.windows.vista.networking_sharing)