fcrontab - tables for driving fcron
A fcrontab is a file containing all tables used by the fcron(8) daemon. In other words, it is the means for a user to tell the daemon "execute this command at this moment". Each user has his own fcrontab, whose commands are executed as his owner.
Blank lines, line beginning by a pound-sign (#) (which are considered as comments), leading blanks and tabs are ignored. Each line in a fcrontab file can be either an environment setting, the entry of a command based on running time or the entry of a command based on time and date (as a normal crontab entry). Any logical line (an entry or an assignment) can be divided into several real lines (the lines which end by a newline character) by placing a backslash (\) before the newline character (\n).
The environment settings are of the form
name = value
where the blanks around equal-sign (=) are ignored and optional. Trailing blanks are also ignored, but you can place the value in quotes (simple or double but matching) to preserve needed leading and trailing blanks of value.
When fcron executes a command, it always sets USER, HOME, and SHELL as defined in /etc/passwd for the owner of the fcrontab from which the command is extracted. HOME and SHELL may be overridden by settings in the fcrontab, but USER may not. Every other environment assignments defined in the user fcrontab are then made, and the command is executed.
Plus, the special variable MAILTO allows you to tell fcron whom it has to mail the command's output to. If MAILTO is not defined, the output will be mailed to the owner of the fcrontab. If it is defined and not empty, the output is mailed to the value of MAILTO. Finally, if it is defined and empty (MAILTO=""), no mail will be sent.
The entries of commands which have to be run once every m minutes of fcron's execution (which is normally the same as m minutes of system's execution) are of the form
@wait-until-first-execution frequency command
where wait-until-first-execution and frequency are both a time value of the form value*multiplier+value*multi- plier+...+value-in-minutes as "12h02" or "3w2d5h1". The first means "12 hours and 2 minutes of fcron execution" while the second means "3 weeks, 2 days, 5 hours and 1 minute of fcron execution". The only valid multipliers are:
multiplier meaning
---------- |
------- |
The "wait-until-first-execution" is optional : if omitted, the value of "frequency" is used.
The time remaining before next execution is saved regularly to limit damages caused by a crash and when fcron exits after having received a SIGTERM signal, i.e. when systems go down. Thus, this kind of entries is particu- larly useful for systems that don't run regularly. The syntax being very simple, it may also useful for tasks which don't need to be run at a specific time and date.
The second type of fcrontab's entries begins by an optional "&", which can be immediately followed by an optional number defining the frequency of execution; it has five time and date fields, and a shell command. The frequency is interpreted as: "run this command after three matches of time and date fields", unless the frequency is set to 1, in which case it will be interpreted as "run this command once during each interval specified". The time and date fields are:
field |
allowed values |
A field is always filled by either an asterisk (*), which acts as "first-last" range, a single number or a list.
List are numbers or range separated with commas (,). For instance: "2,5,15,23".
Ranges of number are of the form "begin-end", where "begin" and "end" are included. For example, "3-5"
specifies the values 3, 4 and 5. You can also add an optional "/number" to a range, where the number specifies skips of the number's value through the range. For example, "0-23/2" can be used in the hours field to specify command execution every other hour. Finally, one or several "~number" can be added to turn off some values in a range. For example, "5-8~6~7" is equivalent to "5,8". The final form of a field is: "a[-b[/c][~d][~e][...]][,f[-g[/h][~i][~j][...]]][,...]", where the letters are integers.
You can also use an asterisk (*) in a field. It acts for "first-last". For example, a "*" in the field minute means all minutes from minute 0 down to minute 59.
Ranges can be included in a list as a single number. For instance: "2,5-10/2~6,15,20-25,30".
Names can also be used for the "month" and "day of week" fields. To do so, use the first three letters of the par- ticular day or month (case doesn't matter). Please note that names are used exactly as numbers: you can use them in a list or a range.
If a day of month and a day of week are given, the command will execute only when both match with the current time and date. For example, with the line "5 10 31 * 7 echo ''" , echo will be executed only days which are a Sun- day AND a 31th.
# use /bin/bash to run commands, ignoring what /etc/passwd says # mail output to thib, no matter whose fcrontab this is # define a variable which is equivalent to " Hello thib and paul ! " |
thib and\ # run after five minutes of execution the first time, # run every day # run once between in the morning and once in the afternoon # run every Sunday and Saturday at 9:05 # run every peer days of march at 18:00, except on 16th |
|
# the line above is equivalent to |
|
# run once every 7 match, so if system is running every day |
If you got the message 8 days ago, then the system has been down \
one day at 10:00 since you got it, etc"
/etc/fcron.allow Users allowed to use fcrontab (one name per line, special name "all" acts for everyone) /etc/fcron.deny Users who are not allowed to use fcrontab (same format as allow file)
fcron(8) , fcrontab(1)
Thibault Godouet <fcron@free.fr>