Re: bad 'find' job in cron

From: Coyle, Jack (Jack.Coyle@REXHEALTH.COM)
Date: Tue May 27 2003 - 11:47:10 EDT


To amplify on Simon's excellent advice, we found here that one actually had
to be even more nefarious in order to get the desired output. Like yourself,
we kept getting the infamous "missing conjunction" message, even with the
command embedded in a (ksh) script. We resorted to assigning the find
command, with all the arguments we were interested in, to a variable (say
cmd for purposes of example) and then executing an "eval ${cmd}" command
within the script to make the annoying message go away and give us our
desired output. I don't know if it is a "feecher" or downright bug in ksh,
but, since we got the output we wanted by including this syntax, we didn't
pursue it any further.

Jack Coyle
Rex Healthcare
(919) 784-3792
jack.coyle@rexhealth.com

> ----------
> From: Green, Simon[SMTP:Simon.Green@EU.ALTRIA.COM]
> Reply To: IBM AIX Discussion List
> Sent: Tuesday, May 27, 2003 11:11 AM
> To: aix-l@Princeton.EDU
> Subject: Re: bad 'find' job in cron
>
> Life is much simpler if you put that sort of thing into a script. That
> way
> it's easier to get a valid test and you don't need to make as many changes
> to crontab. You can also take care of output redirection, environment
> variables and the like within the script. I'd start by doing that and
> testing it again.
>
> Simon Green
> Altria ITSC Europe s.a.r.l.
>
> AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
> AIX FAQ at http://www.faqs.org/faqs/aix-faq/
>
> N.B. Unsolicited email from vendors will not be appreciated.
>
> > -----Original Message-----
> > From: Shawn Bierman [mailto:BiermanS@METHODISTHEALTH.ORG]
> > Sent: 27 May 2003 14:55
> > To: aix-l@Princeton.EDU
> > Subject: bad 'find' job in cron
> >
> >
> > Greetings,
> >
> > I have a job in cron that works fine from the command line
> > but when the cron job runs i get the following email:
> >
> > find: 0652-009 There is a missing conjunction
> >
> >
> > *****************************************************************
> > cron: The previous message is the standard output
> > and standard error of one of the cron commands.
> >
> > The cron entry looks like this:
> > 15 02 * * * (/usr/bin/find /sapbc/Server/logs -name \*.log
> > -mtime +30 -xdev -type f | /usr/bin/xargs rm -f)
> > 20 02 * * * (/usr/bin/find /sapbc/Server/packages/SAP/logs
> > -name \*.log -mtime +30 -xdev -type f | /usr/bin/xargs rm -f)
> >
> >
> > Ran from the command line it works fine. What does cron not
> > like here?
>



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:52 EDT