I follow you. Yes, I am running scripts not -exec 'ing external scripts.<br>cd foo<br>script -a -c "./bar.sh param1 param2" "$log_file<br><br>wash, rinse, repeat...<br><br>It really is a difference between how processes are handled between the two different environment of a regular login and a cron job. I'm rewriting my logger to be basic bash I/O redirects. I think that will resolve the nasty looping processes. script is designed to be able to replay process. Tht's probably not a good thing to have as an automated function :-)<br>
<br><div class="gmail_quote">On Wed, Dec 16, 2009 at 8:32 PM, Ed Cashin <span dir="ltr"><<a href="mailto:ecashin@noserose.net">ecashin@noserose.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Wed, Dec 16, 2009 at 6:49 PM, Jim Kinney <<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>> wrote:<br>
> script runs all hunky-dorey in userland.<br>
><br>
> so time to put it into cron. To cover my bases for inferior cron<br>
> environemnt, the first thing the script does is . ~/.bash_profile which in<br>
> turn runs ~/.bash_rc which runs /etc/bashrc<br>
<br>
</div>If you are "running" scripts, you're creating new bash processes, but<br>
if you use exec instead, you'll replace the running process with a new<br>
one.<br>
<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ cat /tmp/count-procs<br>
#! /bin/sh<br>
ps ax | wc -l<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ cat /tmp/test-run<br>
/tmp/count-procs<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ sh /tmp/test-run<br>
52<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ cat /tmp/test-exec<br>
exec /tmp/count-procs<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ sh /tmp/test-exec<br>
51<br>
ecashin@Ed-Cashins-MacBook-Pro ~$<br>
<div class="im"><br>
...<br>
> Except somehow it now spawns _2_ copies of the running process and the race<br>
> is on! <insert appropriate swearing here><br>
<br>
</div>Do the above comments seem relevant? I can't really tell if that's all<br>
there is to it.<br>
<font color="#888888"><br>
--<br>
Ed Cashin <<a href="mailto:ecashin@noserose.net">ecashin@noserose.net</a>><br>
<a href="http://noserose.net/e/" target="_blank">http://noserose.net/e/</a><br>
<a href="http://www.coraid.com/" target="_blank">http://www.coraid.com/</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br>Actively in pursuit of Life, Liberty and Happiness <br><br>