Please help: How to log data before shutdown?

This is a discussion on Please help: How to log data before shutdown? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi All! Quick question: Assume your PHP script is running in the background executing some long, time consuming process. And ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-07-2004
Jerry
 
Posts: n/a
Default Please help: How to log data before shutdown?

Hi All!

Quick question:
Assume your PHP script is running in the background executing some
long, time consuming process. And while it's running the Host Service
Provider decides to shut down the server for maintenance.

How are running scripts in that case terminated? Will they exit
orderly or will they simply be aborted like pulling the plug?

Will the "register_shutdown_function()" be executed when a server
shut-down exits all running processes?

How can I get my script to write some log data before it is stopped
when the server shuts down or so?

Your help is greatly appreciated!!!
Jerry
Reply With Quote
  #2 (permalink)  
Old 06-07-2004
Paul Delannoy
 
Posts: n/a
Default Re: Please help: How to log data before shutdown?

Jerry a écrit:
> Hi All!
>
> Quick question:
> Assume your PHP script is running in the background executing some
> long, time consuming process. And while it's running the Host Service
> Provider decides to shut down the server for maintenance.
>
> How are running scripts in that case terminated?

YES of course

> Will they exit
> orderly or will they simply be aborted like pulling the plug?

The second helas.

> Will the "register_shutdown_function()" be executed when a server
> shut-down exits all running processes?

Perhaps no, perhaps yes.


> How can I get my script to write some log data before it is stopped
> when the server shuts down or so?

Write your script with some regular 'data save' in a file.

Reply With Quote
  #3 (permalink)  
Old 06-08-2004
Garp
 
Posts: n/a
Default Re: Please help: How to log data before shutdown?


"Jerry" <submitstuff@lycos.com> wrote in message
news:m8j8c0hsms4ko6oka5pl9sbond778rtp2k@4ax.com...
> Hi All!
>
> Quick question:
> Assume your PHP script is running in the background executing some
> long, time consuming process. And while it's running the Host Service
> Provider decides to shut down the server for maintenance.
>
> How are running scripts in that case terminated? Will they exit
> orderly or will they simply be aborted like pulling the plug?
>
> Will the "register_shutdown_function()" be executed when a server
> shut-down exits all running processes?
>
> How can I get my script to write some log data before it is stopped
> when the server shuts down or so?
>
> Your help is greatly appreciated!!!
> Jerry


You'll need to clarify the problem you're having - scripts can stop running
at any second for countless reasons and they should be able to recover from
that on production sites (i.e. not file-locking anything, not relying on
databases not being in transitional states, etc). Database transactions
(autocommit disabled) is the way to go here. Again, no idea what problem
you're trying to avoid.

Garp


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:53 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0