Re: bad 'find' job in cron

From: Green, Simon (Simon.Green_at_EU.ALTRIA.COM)
Date: 05/27/03

  • Next message: Bob Booth - UIUC: "Re: X-Windows Timeout AIX 4.3.3"
    Date:         Tue, 27 May 2003 17:11:49 +0200
    To: aix-l@Princeton.EDU
    
    

    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?


  • Next message: Bob Booth - UIUC: "Re: X-Windows Timeout AIX 4.3.3"

    Relevant Pages

    • Re: Nmon scheduling question
      ... command ran first then in the script is the ps and kill command so it ... Vince this is a great script. ... Cron Job with pid: 135238 Failed ...
      (AIX-L)
    • Script wont run from cron
      ... the command line, but the same script fails when running from cron. ... The /bin/sh script runs, but when it goes to fire up the indexing process, ... set, id and limits. ...
      (freebsd-questions)
    • Re: Cron Job
      ... If you mean the computer itself, put that command ... The standard 'cron' runs jobs at a specific time/date. ... Init or @reboot run jobs when ... Sunday night at 02:00) then copy the script and cron entry. ...
      (comp.os.linux.misc)
    • Cron entry & .profile question
      ... Cron jobs can be confusing at times. ... When I run a script I wrote from ... The bourne shell uses the command "." ... Should I run my cron job as root or should I make a new cron entry ...
      (SunManagers)
    • SUMMARY: cron entry: nth day of every month?
      ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
      (Tru64-UNIX-Managers)