Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2002 23:09:41 +0100
From:      Rogier Steehouder <r.j.s@gmx.net>
To:        Dan Langille <dan@langille.org>
Cc:        questions@freebsd.org
Subject:   Re: crontab entries need a CR/LF at the end
Message-ID:  <20020214230941.A493@localhost>
In-Reply-To: <200202141955.g1EJt3k28638@lists.unixathome.org>; from dan@langille.org on Thu, Feb 14, 2002 at 02:54:59PM -0500
References:  <200202141955.g1EJt3k28638@lists.unixathome.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14-02-2002 14:54 (-0500), Dan Langille wrote:
> I edited ~/crontab and added an entry.  That new line did not end in a 
> CR/LF (i.e. I didn't hit ENTER at the end of the line).  Then I did a 
> crontab ~/crontab and watched /var/log/cron.  The job was never run.
> 
> I then modified the crontab to contain an ENTER at the end of that line, 
> and did another crontab ~/crontab.  Then the job run.
> 
> I've been bitten by this at least three times.  And I've seen other get it 
> too.  IMHO, it breaks POLA.  Anyone agree?  I can't see anything in the 
> man pages about this.  I must also be a simple fix.

On my 4.4-RELEASE crontab(5) gives:

> 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 %
                                                       ^^^^^^^
> character, 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.

So, yes, it needs a newline character at the end.

With kind regards, Rogier Steehouder

-- 
                          ___                          _
-O_\                                                  //
 | /               Rogier Steehouder                 //\
/ \                  r.j.s@gmx.net                  //  \
  <---------------------- 25m ---------------------->

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020214230941.A493>