By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

Please help: How to log data before shutdown?

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.

Jul 17 '05 #2

P: n/a

"Jerry" <su*********@lycos.com> wrote in message
news:m8********************************@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
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.