Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 2021 01:58:43 -0700
From:      Tom Samplonius <tom@samplonius.org>
To:        freebsd-stable@freebsd.org
Subject:   Re: cron line continuation?
Message-ID:  <536D5FEC-DA23-4502-A161-D910D6805E16@samplonius.org>
In-Reply-To: <8C2E306D-032F-4224-B03F-194C30E13D43@develooper.com>
References:  <0d9ed5fb-7b98-8fa5-2429-a00c615afc69@klop.ws> <20210606165738.f944a3649687a4ae09bb3cf6@getmail.no> <50183224.330.1623051742099@localhost> <8C2E306D-032F-4224-B03F-194C30E13D43@develooper.com>

index | next in thread | previous in thread | raw e-mail



> On Jun 7, 2021, at 12:51 AM, Ask Bjørn Hansen <ask@develooper.com> wrote:
> 
> 
> 
>> On Jun 7, 2021, at 00:42, Ronald Klop <ronald-lists@klop.ws> wrote:
>> 
>> which is much better readable. I can't get this to work so the documentation might be inconsistent.
> 
> I don’t think cron supports escaping newline. You can escape % as described, but (as you know) that’s something else.
> 
> The standard solution to this is not to write programs in the cron config. Write a script or program elsewhere and have cron execute it.
> 

  Yes, “\” as a continuation character is not supported.  The cron manpage is correct (no mention of using \ for anything but an escape character).  The https://docs.freebsd.org/doc/13.0-RELEASE/usr/local/share/doc/freebsd/en_US.ISO8859-1/books/handbook/configtuning-cron.html <https://docs.freebsd.org/doc/13.0-RELEASE/usr/local/share/doc/freebsd/en_US.ISO8859-1/books/handbook/configtuning-cron.html>; page is incorrect.

  I’ve also checked the source at https://github.com/freebsd/freebsd-src/blob/373ffc62c158e52cde86a5b934ab4a51307f9f2e/usr.sbin/cron/lib/entry.c   There is no code to merge lines ending with a \ into a single command.

  And I agree, for a large number of sequential commands, a shell is going to superior is every way.  You could also add error recovery, etc.



> Ask


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?536D5FEC-DA23-4502-A161-D910D6805E16>