Re: continuation character in cron jobs
Rick Pasotto wrote:
> On Sun, Oct 21, 2007 at 12:03:30PM -0700, David Liontooth wrote:
>>
>> I'd like to use the continuation character \ in a cron job, but I get an
>> error when I do.
>>
>> I use "crontab -e" to edit the crontab and have this sort of thing:
>>
>> 30 5 * * * script varable variable \
>> variable-text
>>
>> when I try to save, I get this:
>>
>> crontab: installing new crontab
>> "/tmp/crontab.kZ7WHF/crontab":122: bad minute
>> errors in crontab file, can't install
>>
>> Does anyone know if there's a way to get cron to accept a continuation
>> character?
>
> man (5) crontab
>
> 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 crontab file. 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. There is no way to split a single
> command line onto multiple lines, like the shell's trailing "\".
>
Thanks! Really appreciate the info.
I searched the man pages for 'continuation' but missed this. Too bad!
Cheers,
Dave
Reply to: