Re: cron line continuation?

From: Tom Samplonius <tom_at_samplonius.org>
Date: Mon, 7 Jun 2021 01:58:43 -0700
> On Jun 7, 2021, at 12:51 AM, Ask Bjørn Hansen <ask_at_develooper.com> wrote:
> 
> 
> 
>> On Jun 7, 2021, at 00:42, Ronald Klop <ronald-lists_at_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
Received on Mon Jun 07 2021 - 08:58:43 UTC

Original text of this message