[X-Unix] Cron problem

Brian Medley bpm-list-osx-unix at 4321.tv
Fri Jun 24 08:22:08 PDT 2005


On Wed, Jun 22, 2005 at 01:58:40PM -0700, Marley Graham wrote:

> Now I would like to schedule that for every half-hour, so I put the  
> following entry in crontab:
> 
> 0,30 7-16 * * 1-6 screencapture /mgscreen$( date +%R )
> 
> and I get the following error reported through Unix mail:
> 
> Subject: Cron <marleygraham at Marley-Grahams-Computer> screencapture / 
> mgscreen$( d
> X-Cron-Env: <SHELL=/bin/sh>
> X-Cron-Env: <PATH=/usr/bin:/bin>
> X-Cron-Env: <LOGNAME=marleygraham>
> X-Cron-Env: <USER=marleygraham>
> X-Cron-Env: <HOME=/Users/marleygraham>
> Date: Wed, 22 Jun 2005 13:00:00 -0700 (PDT)
> 
> /bin/sh: -c: line 1: unexpected EOF while looking for matching `)'
> /bin/sh: -c: line 2: syntax error: unexpected end of file
> 
> Can someone tell me why cron doesn't like the syntax when it works OK  
> on the command line?

Sorry for the late reply.  I know you've already fixed this, but
I don't recal reading someone giving the reason why the above
did not work.  I believe it did not work because of the "%".
>From the crontab man page:

     The ``sixth'' field (the rest of the line) specifies the command to be
     run.  The entire command portion of the line, up to a newline or % char-
     acter, will be executed by /bin/sh or by the shell specified in the SHELL
     variable of the cronfile.  Percent-signs (%) in the command, unless
     escaped with backslash (\), will be changed into newline characters, and
     all data after the first % will be sent to the command as standard input.
     ...

Therefore, perhaps this would have worked:

    0,30 7-16 * * 1-6 screencapture /mgscreen$( date +\%R )

-- 
~`^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-., \|/  (___)  \|/ _,.-=~'`^`
                                      @~./'O o`\.~@
      "Knowledge is Power"           /__( \___/ )__\  *PPPFFBT!*
         -- Francis Bacon               `\__`U_/'
 _.-=~'``'~=-._.-=~'``'~=-._.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~'^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-.,__,.-==--^'~=-.,__,.-=~'`^`


More information about the X-Unix mailing list