scripting error wont exit

  • Follow


I am writing a script that calls multiple scripts, basically, shut down
database, do backup, bring app back up.  I am running this as a cron that
logs it to a file.

The problem being is that when the app comes back up it starts sending data
frequently about the app to the screen that brought the app up. Which means
the log file that I had the cron job write to is still collecting stats and
is still open.

How do I end the script is it just...
EOF




0
Reply LHradowy 8/11/2003 4:09:13 PM

In article <KcPZa.31863$Rz6.46245@news1.mts.net>,
LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
>I am writing a script that calls multiple scripts, basically, shut down
>database, do backup, bring app back up.  I am running this as a cron that
>logs it to a file.
>
>The problem being is that when the app comes back up it starts sending data
>frequently about the app to the screen that brought the app up. Which means
>the log file that I had the cron job write to is still collecting stats and
>is still open.
>
>How do I end the script is it just...

Redirect output for the command that starts the app back up:

start_app_up >/dev/null 2>&1

However, this has the misfeature of also losing any error messages that the
startup command might display.

The *right* solution is for the startup command to redirect its own stdout
and stderr when it forks off into a daemon.

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
0
Reply Barry 8/11/2003 5:47:40 PM


1 Replies
183 Views

(page loaded in 0.043 seconds)

Similiar Articles:













7/26/2012 7:26:06 AM


Reply: