<div>Hiya, never thought of stracing cron itself, will try that tomorrow (is a bit too busy to risk it going down atm).</div>
<div> </div>
<div>Thanks, Ian<br><br> </div>
<div><span class="gmail_quote">On 10/3/05, <b class="gmail_sendername">Mark Belanger</b> <<a href="mailto:mark_belanger@ltx.com">mark_belanger@ltx.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Ian mu wrote:<br>> Ok, weirder, thanks for the advice by the way, I guess its isolated it<br>> somewhat and not where I thought it would be....added the strace, but
<br>> looks like not needed as never gets that far...<br><br><br>The next thing I would do is to attach strace to cron just before<br>it kicks off.  Make sure to capture the output - there will be a lot<br>of it. strace -p PIDofCron -f -o/path/somefile
<br><br>You might also look at the cron file with an octal editor to make<br>sure there are no funny characters in it.  Or just create a brand<br>new one.<br><br>I would also look carefully each directory in the path and<br>
the contents of them as well i.e.<br><br>ls -ld /home<br>ls -la /home<br>ls -ld /home/statsman<br>ls -la /home/statsman<br>ls -ld /home/statsman/stats<br>ls -la /home/statsman/stats<br><br>-Mark<br><br>><br>> Piped the cron commandline to a file crondebug as mark suggested, its
<br>> created at cron run time, but empty.<br>> 36 13 * * *<br>>  >/home/statsman/stats/crondebug<br>><br>> For the first line of the run_stats.sh (tried also with #!/bin/bash)<br>> file it calls I added
<br>><br>> echo "stage 1" >> /home/statsman/stats/gendebug<br>><br>> Run it manually from console it echos stage 1, (also echo stage 2 I<br>> added, then after that the perl script is invoked) fine.
<br>><br>> Run from cron it never even does the echo "stage 1" to the file (or at<br>> least doesn't create it).<br>><br>> So it looks like its either dying on execing the file and not getting<br>
> any further as it never writes the first line of the simple bash script<br>> or not even trying to call the file? (file gendebug isn't even created).<br>><br>> More puzzled at this moment than I thought (nothing in root mail from
<br>> cron either btw, and rest of crontab seems ok, I leave the line in just<br>> comment out the line with a single # and it doesn't crash ).<br>><br>> Baffled :), thanks again, Ian<br>><br>><br>><br>
><br>> On 10/3/05, *Ingimar Robertsson* <<a href="mailto:iar@skyrr.is">iar@skyrr.is</a> <mailto:<a href="mailto:iar@skyrr.is">iar@skyrr.is</a>>><br>> wrote:<br>><br>>     You could also check what environment variables the perl and shell
<br>>     scripts<br>>     depend upon.  Perhaps they are missing in the cron environment (Cron<br>>     jobs<br>>     don't get the whole shell environment, which might explain why it<br>>     does work<br>
>     from the shell)<br>><br>><br>>     On Mon, Oct 03, 2005 at 07:39:48AM -0400, Mark Belanger wrote:<br>>      > Ian mu wrote:<br>>      > > Basically I have a perl script that runs once, first thing every
<br>>      > > morning, gathering some stats (currently turned off due to<br>>     problem).<br>>      > > Crontab -l shows the following...<br>>      > ><br>>      > > 00 6  * * * nice /home/statsman/stats/run_stats.sh  >/dev/null
<br>>     2>&1 (.sh<br>>      > > file basically sources with full path a config with some vars,<br>>     then runs<br>>      > > the perl script).<br>>      ><br>>      > The first thing I would do to put some echos in run_stats.sh
<br>>      > and change > /dev/null to > /path/somefile<br>>      ><br>>      > If you're getting as far as the perl script, put some print<br>>      > statements in it.<br>>      ><br>
>      > You might try doing an strace from cron:<br>>      ><br>>      > 00 6  * * * strace -f -oOutputFile /home/statsman/stats/run_stats.sh<br>>      > >/path/somefile 2>&1<br>>      >
<br>>      > -Mark<br>>      ><br>>      > _______________________________________________<br>>      > CentOS mailing list<br>>      > <a href="mailto:CentOS@centos.org">CentOS@centos.org</a>
 <mailto:<a href="mailto:CentOS@centos.org">CentOS@centos.org</a>><br>>      > <a href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a><br>><br>><br>>     Bestu kveðjur,
<br>><br>>     Ingimar<br>><br>>     --<br>>     Ingimar Róbertsson, kerfisstjóri, RHCE          EMAIL: <a href="mailto:iar@skyrr.is">iar@skyrr.is</a><br>>     <mailto:<a href="mailto:iar@skyrr.is">iar@skyrr.is
</a>><br>>     Skýrr hf                                        TEL:   +354-5695100<br>>     Ármúli 2, 108 Reykjavík                         FAX:   +354-5695251<br>>                <a href="http://www.skyrr.is/legal/disclaimer.txt">
http://www.skyrr.is/legal/disclaimer.txt</a><br>>     _______________________________________________<br>>     CentOS mailing list<br>>     <a href="mailto:CentOS@centos.org">CentOS@centos.org</a> <mailto:<a href="mailto:CentOS@centos.org">
CentOS@centos.org</a>><br>>     <a href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a><br>><br>><br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> CentOS mailing list<br>> <a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>> <a href="http://lists.centos.org/mailman/listinfo/centos">
http://lists.centos.org/mailman/listinfo/centos</a><br><br><br>--<br>Mark Belanger<br>LTX Corporation<br>_______________________________________________<br>CentOS mailing list<br><a href="mailto:CentOS@centos.org">CentOS@centos.org
</a><br><a href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a><br></blockquote></div><br>