[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Shell script help
- From: Cameron Simpson <cs zip com au>
- To: redhat-list redhat com
- Subject: Re: Shell script help
- Date: Thu, 1 Apr 1999 00:53:32 +0000
On 1 Apr 1999, in message <Pine LNX 4 02 9904010114390 17032-100000 possum os2 ami com au>
John Summerfield <summer OS2 ami com au> wrote:
| > > and quits. I want the second script to run asychronously -but- to continue
| > > running when the cgi script
| > > quits. I thought of using "at" but is there a pure bash solution?
| > start your second script with:
| > command-to-start-script &
| > or
| > nohup command-to-start-script &
| The at command is probably better though. I assume you want the second
| script to run asynchronously because it's longer running or more demanding.
| You probably don't want it being run at whatever priority is appropriate
| for your server.
So just renice it:
nice other-script &
BTW, I wouldn't normally expect nohup to be necessary in a CGI environment.
One important point to bear in mind is that the CGI output is the
stdout of the CGI script. So for the web page the user is viewing to
finish loading your bg script must redirect its standard output:
nice otherscript >somewhere &
Perhaps the error output too, to avoid cluttering the server log:
nice otherscript >somewhere 2>>err_log_for_the_other_script &
(The >> is to append to the file. Maybe what you want, maybe not.)
--
Cameron Simpson, DoD#743 cs zip com au http://www.zip.com.au/~cs/
Insisting on perfect safety is for people who don't have the balls to live
in the real world. - Mary Shafer, NASA Ames Dryden
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]