Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

background perl script

Status
Not open for further replies.

mridangagarwal

Programmer
Jul 25, 2007
5
0
0
FI
Hello everyone.

How do i make a Perl script execute in the background on an Apache Web Server. The script should continue to run even if the browser is closed. This is easily accomplished in PHP, I wonder how to do it in Perl? Also, is there an easy way to check if the script is still running. My damned webhost kills my long script it seems.
 
The absolute simplest method:

perldoc How do I start a process in the background?

I doubt there will be a fool proof method from keeping you hosting service from killing your daemon. At most, maybe you should just plan on only running it for 5 minutes at a time. Don't know what purpose it's serving, but most web hosting services will kill any daemons that run too long as standard policy.

- Miller
 
Is there any way it's inefficiencies in the script that's causing it to run for so long? What does it do?
 
Well, I need to download a couple of GB's of data on to webserver from another server.

You mentioned that webservers kill a process after a while (my case approx. 15 minutes). How come mass mailing softwares that send out thousands of mails execute for hours without being terminated by the server. E.g Mailman (Perl Newsletter Software)
 
If you are on a shared server there will be a limit. If you need to run programs that take a long time you need to get a dedicated server.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top