Click here to get back home

A dumb question but...

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
A dumb question but... Bill H 06-09-2008
Posted by Bill H on June 9, 2008, 3:26 pm
Please log in for more thread options
I have this perl script that I have been using for bout 10 years that
sends out a mass email to one of my clients member list (about 4,000)
people. I run it at a shell prompt on an Apache server and it will
display back a "sent email address" for each one it processes. Takes
about 2 hours to run through. I am not concerned about speeding it up
or anything since I only do it once a week and usually off eating
lunch while it runs, but I have always wondered. Would perl be
notified and / or care if I closed that shell window or would it just
continue on till it was done?

Bill H

Posted by nolo contendere on June 9, 2008, 3:41 pm
Please log in for more thread options
> I have this perl script that I have been using for bout 10 years that
> sends out a mass email to one of my clients member list (about 4,000)
> people. I run it at a shell prompt on an Apache server and it will
> display back a "sent email address" for each one it processes. Takes
> about 2 hours to run through. I am not concerned about speeding it up
> or anything since I only do it once a week and usually off eating
> lunch while it runs, but I have always wondered. Would perl be
> notified and / or care if I closed that shell window or would it just
> continue on till it was done?


That depends on your shell, and how it handles hangup signals. Use
nohup explicitly if you want to be sure that your script will continue
to run even after you close your window.

Posted by Joost Diepenmaat on June 9, 2008, 3:43 pm
Please log in for more thread options

> I have this perl script that I have been using for bout 10 years that
> sends out a mass email to one of my clients member list (about 4,000)
> people. I run it at a shell prompt on an Apache server and it will
> display back a "sent email address" for each one it processes. Takes
> about 2 hours to run through. I am not concerned about speeding it up
> or anything since I only do it once a week and usually off eating
> lunch while it runs, but I have always wondered. Would perl be
> notified and / or care if I closed that shell window or would it just
> continue on till it was done?

By default programs exit on a SIGHUP, so unless the script you're
using takes care to handle that, it will probably exit.

If you want to, you could run the program in screen instead (I
actually prefer this for long-running processes, since it can be
slightly too easy to kill an xterm / ssh session).

See: http://en.wikipedia.org/wiki/SIGHUP
http://en.wikipedia.org/wiki/GNU_Screen


--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

Posted by Martijn Lievaart on June 9, 2008, 5:01 pm
Please log in for more thread options
On Mon, 09 Jun 2008 21:43:35 +0200, Joost Diepenmaat wrote:

> If you want to, you could run the program in screen instead (I actually
> prefer this for long-running processes, since it can be slightly too
> easy to kill an xterm / ssh session).

I second that, screen is a /very/ good solution.

M4

Posted by Martijn Lievaart on June 9, 2008, 3:59 pm
Please log in for more thread options
On Mon, 09 Jun 2008 12:26:26 -0700, Bill H wrote:

> I have this perl script that I have been using for bout 10 years that
> sends out a mass email to one of my clients member list (about 4,000)
> people. I run it at a shell prompt on an Apache server and it will
> display back a "sent email address" for each one it processes. Takes
> about 2 hours to run through. I am not concerned about speeding it up or
> anything since I only do it once a week and usually off eating lunch
> while it runs, but I have always wondered. Would perl be notified and /
> or care if I closed that shell window or would it just continue on till
> it was done?

On most (all) shells, that would send a SIGHUP to the process. If you
don't catch that signal, it kills the process.

If you don't want that, either use nohup or batch.

M4

Similar ThreadsPosted
lists,shift,subs and dumb question November 5, 2004, 5:23 pm
dumb question about whether hashes get cleared from memory automatically July 25, 2006, 6:36 pm
I want to ask you the most important question of your life. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? The reason some peopl May 22, 2005, 10:11 am
I want to ask you the most important question of your life. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? The reason some peopl May 24, 2005, 8:49 am
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, April 21, 2005, 1:25 pm
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, April 22, 2005, 3:33 pm
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, April 24, 2005, 6:50 pm
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, May 1, 2005, 11:27 am
MS Perl question -- how to use hacked script to work correctly(was Question on loops and return values or sumpin) December 8, 2004, 12:59 pm
Question September 9, 2004, 11:05 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap