[CentOS] Cron script crashing server...

Ian mu mu.llamas at gmail.com
Mon Oct 3 12:26:11 UTC 2005


Ok, weirder, thanks for the advice by the way, I guess its isolated it
somewhat and not where I thought it would be....added the strace, but looks
like not needed as never gets that far...
 Piped the cron commandline to a file crondebug as mark suggested, its
created at cron run time, but empty.
36 13 * * * /home/statsman/stats/run_stats.sh
>/home/statsman/stats/crondebug
 For the first line of the run_stats.sh (tried also with #!/bin/bash) file
it calls I added
 echo "stage 1" >> /home/statsman/stats/gendebug
 Run it manually from console it echos stage 1, (also echo stage 2 I added,
then after that the perl script is invoked) fine.
 Run from cron it never even does the echo "stage 1" to the file (or at
least doesn't create it).
 So it looks like its either dying on execing the file and not getting any
further as it never writes the first line of the simple bash script or not
even trying to call the file? (file gendebug isn't even created).
 More puzzled at this moment than I thought (nothing in root mail from cron
either btw, and rest of crontab seems ok, I leave the line in just comment
out the line with a single # and it doesn't crash ).
 Baffled :), thanks again, Ian


 On 10/3/05, Ingimar Robertsson <iar at skyrr.is> wrote:
>
> You could also check what environment variables the perl and shell scripts
> depend upon. Perhaps they are missing in the cron environment (Cron jobs
> don't get the whole shell environment, which might explain why it does
> work
> from the shell)
>
>
> On Mon, Oct 03, 2005 at 07:39:48AM -0400, Mark Belanger wrote:
> > Ian mu wrote:
> > > Basically I have a perl script that runs once, first thing every
> > > morning, gathering some stats (currently turned off due to problem).
> > > Crontab -l shows the following...
> > >
> > > 00 6 * * * nice /home/statsman/stats/run_stats.sh >/dev/null 2>&1 (.sh
> > > file basically sources with full path a config with some vars, then
> runs
> > > the perl script).
> >
> > The first thing I would do to put some echos in run_stats.sh
> > and change > /dev/null to > /path/somefile
> >
> > If you're getting as far as the perl script, put some print
> > statements in it.
> >
> > You might try doing an strace from cron:
> >
> > 00 6 * * * strace -f -oOutputFile /home/statsman/stats/run_stats.sh
> > >/path/somefile 2>&1
> >
> > -Mark
> >
> > _______________________________________________
> > CentOS mailing list
> > CentOS at centos.org
> > http://lists.centos.org/mailman/listinfo/centos
>
>
> Bestu kveðjur,
>
> Ingimar
>
> --
> Ingimar Róbertsson, kerfisstjóri, RHCE EMAIL: iar at skyrr.is
> Skýrr hf TEL: +354-5695100
> Ármúli 2, 108 Reykjavík FAX: +354-5695251
> http://www.skyrr.is/legal/disclaimer.txt
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20051003/7ac36519/attachment.html>


More information about the CentOS mailing list