[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Illegal characters in cron



On Tue, 28 Oct 2003 17:05:46 -0500,
Derrick 'dman' Hudson wrote:
> 
> On Wed, Oct 29, 2003 at 05:46:59AM +0800, csj wrote:

> | I'm having trouble getting the following to work in my
> | crontab:
> | 
> | 30 1 * * *	mailfilter -M ~/.mailfilterrc -L ~/autosave/log/mailfilter/mailfilter-`date +%Y%m%d%H%M`.log

[...]

> It took me a long time to figure out the same problem (but with
> a different command).  Well, my cron job that wouldn't work was
> a monthly job and so I pretty much had to wait until the next
> month to test any changes.
> 
> The key is this snippet from crontab(5) :
> 
>        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.  Percentsigns (%) in the
>        command, unless escaped with backslash (\), will be
>        changed into newline charac ters, and all data after the
>        first % will be sent to the command as standard input.
> 
> Change all '%' in your command to '\%'.

Thanks to you and Ken.  Pretty obvious I should have RTFMed.  But
my problem is "crontab(1)".  I've always wondered what those
parenthetical man numbers(N) mean.  Time to "man man";-).



Reply to: