cron - specifikace dne v mesici + dne v tydnu
Peter
konfery na lentus.sk
Sobota Říjen 2 15:37:21 CEST 2004
Jan Gregor wrote:
> Zdravim,
>
> Narazil jsem na podle me nelogicke chovani cronu, kdy zadani dne
> v tydnu a zaroven dne v mesici chape jako OR - vykona se tedy v obou
> pripadech a ne pri splneni obou podminek.
>
> Hledani puvodu tohoto chovani me dovedlo k informaci, ze toto "chovani"
> je ze System V a bylo prevzato take solarisem a linuxem. Originalni BSD
> systemy by se mely chovat spravne (tedy chapat tyto podminky jako AND).
>
> Zajimalo by me proc bylo prevzato chovani System V, a ne BSD vetve
> (ktere se me zda logictejsi), a jestli nekdo narazil na podobne
> vypecenosti v linuxu. Pripadne jak se chovaji soucasne BSD systemy.
>
Names can also be used for the ``month'' and ``day of week'' fields.
Use the first three letters of the particular day or month (case doesn't
mat-
ter). Ranges or lists of names are not allowed.
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 % charac-
ter, 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, ala the shell's trailing "\".
Note: The day of a command's execution can be specified by two
fields -- day of month, and day of week. If both fields are
restricted (i.e.,
aren't *), the command will be run when either field matches the
current time. For example,
``30 4 1,15 * 5'' would cause a command to be run at 4:30 am on
the 1st and 15th of each month, plus every Friday.
**********
EXTENSIONS
When specifying day of week, both day 0 and day 7 will be
considered Sunday. BSD and ATT seem to disagree about this.
Lists and ranges are allowed to co-exist in the same field.
"1-3,7-9" would be rejected by ATT or BSD cron -- they want to see "1-3"
or "7,8,9"
ONLY.
Ranges can include "steps", so "1-9/2" is the same as "1,3,5,7,9".
Months or days of the week can be specified by name.
Environment variables can be set in the crontab. In BSD or ATT,
the environment handed to child processes is basically the one from /etc/rc.
Command output is mailed to the crontab owner (BSD can't do
this), can be mailed to a person other than the crontab owner (SysV
can't do this), or
the feature can be turned off and no mail will be sent at all
(SysV can't do this either).
All of the `@' commands that can appear in place of the first
five fields are extensions.
AUTHOR
Paul Vixie <paul na vix.com>
4th Berkeley Distribution 24
January 1994
CRONTAB(5)
Peter
www.lentus.sk
Další informace o konferenci Linux