[OpenIndiana-discuss] Syntax Errors From Crontab Lines

James Carlson carlsonj at workingcode.com
Thu Jan 15 15:25:41 UTC 2015


On 01/15/15 07:37, jay at m5.chicago.il.us wrote:
> 
> Why has no one pointed out the obvious problem with the original
> poster's crontab line -- that it contained a percent sign?  Everything
> following the percent sign in a crontab line is input to the command
> prior to the percent sign, with subsequent percent signs translated to
> newlines.  Or is that no longer true in OpenIndiana?  It is documented
> on my Schillix system, and it has been the behavior of cron since the
> beginning of time.  It is the only way to run a command with more than
> one line of standard input, without creating a separate input file.

Yes, that's indeed still true.  It's even true on independent
implementations of cron that conform with POSIX, such as ISC's.

Of course, as the other posters have suggested, trying to write a
complete script inside the confines of crontab is just the wrong way to
go because it ends up being much harder to manage over time and thus
prone to error.

You're better off writing little scripts and then managing those, even
if it seems to be "hard" to write a small file.  For one thing, you can
invoke the script from the command line easily in order to test changes,
rather than having to cut-n-paste in and out of the crontab file.

-- 
James Carlson         42.703N 71.076W         <carlsonj at workingcode.com>



More information about the openindiana-discuss mailing list