set -x provides to useful insight. Maybe I need to get stronger glasses...<br><br>Something that crossed my mind: In the script are multiple sub scripts being called to do the actual operations. So to facilitate logging I wrapped each external call using script -a -c "scriptname param1 param2, etc" "$log_file"<br>
<br>This will take the contents of any output from the scripts and dump them to the log_file. So there is two processes with identical name plus a third for the actual script itself. I thing the first is the script command itself, the second is the process that does the IO redirection and the third is the actual called script running.<br>
<br>I have a very strong suspicion that the screen IO redirect with script is not compatible with a no stdout cron. script was designed to exactly copy what is done on a screen session (spaces, tabs and backspaces) so it can literally be replayed either at the end of pipe or later as a process.<br>
<br>I'm not sure how cron does its IO but if it loops back on itself that would allow each script process to launch a second run of each process.<br><br><br>AAAARRRRGGGGHHHH!<br><br>so much for being clever.<br><br>Back to the basic 1>>"$log_file" 2>&1<br>
<br><div class="gmail_quote">On Wed, Dec 16, 2009 at 7:36 PM, Tim Watts <span dir="ltr"><<a href="mailto:timtw@earthlink.net">timtw@earthlink.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;">
Does set -x reveal anything?<br>
<br>
Would it behave better if you didn't source .bash_profile (without<br>
opening up another can o worms)?<br>
<div><div></div><div class="h5"><br>
<br>
On Wed, 2009-12-16 at 19:13 -0500, Jim Kinney wrote:<br>
> 2 8 * * * /home/user/bin/scriptname<br>
><br>
> same incarnation works with a different script in the same directory<br>
> but has no database work to do.<br>
><br>
> BTW: <esc>wq won't email in gmail as I just tried and discovered<br>
> (without a vi plugin I saw)<br>
><br>
> On Wed, Dec 16, 2009 at 7:00 PM, JK <<a href="mailto:jknapka@kneuro.net">jknapka@kneuro.net</a>> wrote:<br>
> Post the crontab line, please?<br>
><br>
><br>
> On 12/16/2009 4:49 PM, Jim Kinney wrote:<br>
> > script runs all hunky-dorey in userland.<br>
> ><br>
> > so time to put it into cron. To cover my bases for inferior<br>
> cron<br>
> > environemnt, the first thing the script does is .<br>
> ~/.bash_profile which<br>
> > in turn runs ~/.bash_rc which runs /etc/bashrc<br>
> ><br>
> > So it now looks just like a login env.<br>
> ><br>
> > maybe...<br>
> ><br>
> > Except somehow it now spawns _2_ copies of the running<br>
> process and the<br>
> > race is on! <insert appropriate swearing here><br>
> ><br>
> > Since it's highly sequence dependent data processing and<br>
> database<br>
> > insertion and database processing, multiple out of order<br>
> steps is very,<br>
> > VERY bad.<br>
> ><br>
> > Solution: make the first line a -f test for a pid file and<br>
> exit if it<br>
> > exists. The second line writes the pid file. Shouldn't have<br>
> to do this...<br>
> ><br>
> > Still totally stumped on the multiple simultaneous<br>
> processes.<br>
> ><br>
> > --<br>
> > --<br>
> > James P. Kinney III<br>
> > Actively in pursuit of Life, Liberty and Happiness<br>
> ><br>
> ><br>
> ><br>
><br>
> > _______________________________________________<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>
><br>
><br>
> --<br>
> The first mistake was granting corporations the rights of<br>
> citizens.<br>
> Now *only* corporations have the rights of citizens. --<br>
> Unknown<br>
> _______________________________________________<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>
><br>
><br>
><br>
> --<br>
> --<br>
> James P. Kinney III<br>
> Actively in pursuit of Life, Liberty and Happiness<br>
><br>
> _______________________________________________<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>
<br>
<br>
</div></div>________<br>
I believe love is primarily a choice and only sometimes a feeling. If<br>
you want to feel love, choose to love and be patient.<br>
-- Real Live Preacher<br>
<br>
<br>_______________________________________________<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>
<br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br>Actively in pursuit of Life, Liberty and Happiness <br><br>