473,794 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get cgi script to begin execution of another script...

I've posted something similar to this already, but now I'm more sure
of what I'm asking.

Basically I've a CGI script, that when executed by the user, I want to
call another script that does a very long running task (10 hours +)
and print a message on the screen saying that the user will be emailed
on completion of the very long task. The script executing the very
long task will then email the user on completion.

So far I have something like this (leaving out the obvious)...

CGI script:

pid = subprocess.Pope n(["python", "spawn.py"]).pid
print "Thanks you will be emailed on completion"
Spawn.py script:

doVeryLongCalc( )
emailUser()
Basically the problem with this is that the cgi script page in the
browser keeps on acting as if its loading until the Spawn.py script is
finished executing. Somehow apache "knows" that the spawned process is
still running in the background. So I'm basically asking if I can
somehow spawn a script that will be completely independent of its
parent script? So Apache doesn't know its running and the page
finishes loading?

Thanks if anyone can help...
Mar 12 '08 #1
1 1597
sophie_newbie <pa**********@g mail.comwrote:
>Basically I've a CGI script, that when executed by the user, I want to
call another script that does a very long running task (10 hours +)
and print a message on the screen saying that the user will be emailed
on completion of the very long task. The script executing the very
long task will then email the user on completion.
http://aspn.activestate.com/ASPN/Coo.../Recipe/278731
was helpful to me in solving this problem.

--
\S -- si***@chiark.gr eenend.org.uk -- http://www.chaos.org.uk/~sion/
"Frankly I have no feelings towards penguins one way or the other"
-- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
Mar 13 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2101
by: SimonC | last post by:
A couple of questions: (1) I have some PHP code that may take a while to execute - say 30-45 seconds or more - and I'm concerned that a browser may give up, and report an error because a page is not returned within a certain amount of time. How can I handle this? Should my PHP script (that generates the webpage) call another PHP script to do the long-processing task, allowing it to exit earlier (with a generated webpage), or what?
10
5431
by: Doug | last post by:
I have a script that does a huge database update, which takes a long time. However, the host I am running on (and I suspect most hosts) are running in "safe mode." This means I cannot change the maximum execution time of scripts. So, the script stops right in the middle of doing the update. On top of that, I am trying to make code that I can distribute to others. As of now, the only way that this script can be run is with sys admin...
1
1408
by: Angelo Secchi | last post by:
Hi, I would like Python to interrupt the execution of a script in case an if condition turns out to be TRUE. What is the proper way to do that? Thanks, a. -- ======================================================== Angelo Secchi PGP Key ID:EA280337
6
34181
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of the relevant infomation, in a binary format. SQL Enterprise manager offers no way to script out those diagrams, so I have created two Transact SQL components, one User Function and one User Procedure, which together provide a means to script...
3
4878
by: muzamil | last post by:
To get rid of redundant data in a table, my cleint will be providing something like this: IDtokeep Ids to delete 34 24,35,49 12 14,178,1457 54 32,65,68 I have to write a script for each of the above rows which looks like
3
47833
by: iam980 | last post by:
Hello All. We have tested following SQL script from query analyzer: -- Script begin DECLARE @I int; SET @I = 1; WHILE @I < 10000000 BEGIN SET @I = @I + 1; END -- Script end
2
2031
by: ern | last post by:
My command-line application must be able to run text scripts (macros). The scripts have commands, comments, and flags. Comments are ignored (maybe they are any line beginning with " ; ") Commands are executed as if the user *manually* typed them in the console. Flags are special commands that tell the program where to BREAK, LOOP, START. A typical script may look like this: ; This is my script. It will test my mp3 player... START:
3
2242
by: Tobius | last post by:
I want to be able to define a custom onerror event that detects an attempt to call a known function and load a file if it's not already loaded and re-call the function. The only problem is that any triggering of the onerror event stops execution of the script block in question. Is there a workaround for this? Here's an example of what I'm trying to accomplish: ==================================================
1
1602
by: =?Utf-8?B?Sm9obkJhdGVz?= | last post by:
Problem: I need to backup and clear the security event log. I have this working via a vbsscript which I will post below. However while I can use this script manually it is not user friendly and my end users who have to perform the backup and clear chore weekly are the "where is the button" types. I have written a vb.net 2005 gui as a front end that can launch my script and run it ok but the problem is since it is a script running in a...
0
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.