473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Jul 17 '05 #1
2 1271
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Allan Bredahl | last post by:
Hi All I am trying to construct an application that is able to cancel a machine shutdown, reboot or logoff. And after performing some stuff to perform the original shutdown order :...
3
by: Senthil | last post by:
Hi, I would like to know the code for reboot and shutdown windows xp professional using VB.Net. thanx Senthil
5
by: Sinan Nalkaya | last post by:
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when...
4
by: pamelafluente | last post by:
Hi Guys, I have a small application which uses a NotifyIcon. The user can set a flag (PreventClosing ) so that when he clicks on the form-cancel button "X", the program will instead be...
1
by: Avi G | last post by:
Hi, i have this code private void ShutDown_Click(object sender, EventArgs e) { if (checkBox1.Checked) { Process ShutDown = new Process();
2
by: Aravind | last post by:
I have 3rd party dll plugin COM interface, when loaded executes the following functions. public class Test: IPlugin { public void Innitialize(IPluginApp obj, int pluginHandle) { //gets the...
1
by: google | last post by:
MySQL Server is version 4.1.7 (I know I should upgrade, and I will if that is the problem but it has been working fine for 1.5 years now and only recently has started to have this problem). Server...
2
by: itsvineeth209 | last post by:
My task is to create login control without using login control in tools. I shouldnt use sqldatasource or any other. I should use only data sets, data adapters and data readers etc. U had created...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.