Library
Module
Module type
Parameter
Class
Class type
Cron is a task scheduler standardized by POSIX.
type field =
| All
All
is equivalent to "*".
| List of element list
Enumerate [1; 3; 9]
is equivalent to "1,3,9"
Not all integers are valid. A validator makes sure only valid values are used.
val valid_minute : validator
A minute is valid if in 0..59
.
val valid_hour : validator
An hour is valid if in 0..23
.
val valid_day_of_the_month : validator
A day of the month is valid if in 1.31
.
val valid_day_of_the_week : validator
A day of the week is valid if in 0..6
.
val valid_month_of_the_year : validator
A month of the year is valid if in 1..12
.
val make_entry :
?minute:field ->
?hour:field ->
?day_of_the_month:field ->
?month_of_the_year:field ->
?day_of_the_week:field ->
string ->
entry
make_entry command
creates a crontab entry executing command
.
day_of_the_month entry
returns an integer in 1..31
. None
means Any
.
month_of_the_year entry
returns an integer in 0..11
. None
means Any
.
day_of_the_week entry
returns an integer in 0..6
. None
means Any
.
val entry_of_string : string -> entry
entry_of_string line
turns a crontab line into an entry.
val string_of_entry : entry -> string
string_of_entry entry
produces a textual representation of entry
conforming to the POSIX standard.
val crontab_of_string : string -> t
crontab_of_string input
reads input
as a crontab is possible.
val string_of_crontab : t -> string
string_of_crontab crontable
produces a textual representation of crontable
conforming to the POSIX standard.
exception CrontabError of Unix.process_status
val crontab_install : ?user:string -> t -> unit
crontab_install crontable
installs the crontable
.
val crontab_get : ?user:string -> unit -> t
crontab_list ()
returns the currently installed cron table.
val crontab_insert_entry : ?user:string -> entry -> unit
crontab_insert_entry entry
installs a new entry
in the current crontab, if it is not already there.
val crontab_remove_entry : ?user:string -> entry -> unit
crontab_remove_entry entry
removes an entry
in the current crontab.
crontab_remove ()
removes the currently installed cron table.