/usr/share/augeas/lenses/dist/cron.aug is in augeas-lenses 1.2.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | (*
Module: Cron
Parses /etc/cron.d/*, /etc/crontab
Author: Raphael Pinson <raphink@gmail.com>
About: Reference
This lens tries to keep as close as possible to `man 5 crontab` where
possible.
About: License
This file is licensed under the LGPL v2+, like the rest of Augeas.
About: Lens Usage
Sample usage of this lens in augtool
* Get the entry that launches '/usr/bin/ls'
> match '/files/etc/crontab/entry[. = "/usr/bin/ls"]'
About: Configuration files
This lens applies to /etc/cron.d/* and /etc/crontab. See <filter>.
*)
module Cron =
autoload xfm
(************************************************************************
* Group: USEFUL PRIMITIVES
*************************************************************************)
(* Group: Generic primitives *)
(* Variable: eol *)
let eol = Util.eol
(* Variable: indent *)
let indent = Util.indent
(* Variable: comment *)
let comment = Util.comment
(* Variable: empty *)
let empty = Util.empty
(* Variable: num *)
let num = /[0-9*][0-9\/,*-]*/
(* Variable: alpha *)
let alpha = /[A-Za-z]{3}/
(* Variable: alphanum *)
let alphanum = (num|alpha) . ("-" . (num|alpha))?
(* Variable: entry_prefix *)
let entry_prefix = /-/
(* Group: Separators *)
(* Variable: sep_spc *)
let sep_spc = Util.del_ws_spc
(* Variable: sep_eq *)
let sep_eq = Util.del_str "="
(************************************************************************
* Group: ENTRIES
*************************************************************************)
(************************************************************************
* View: shellvar
* A shell variable in crontab
*************************************************************************)
let shellvar =
let key_re = /[A-Za-z-1-9_]+(\[[0-9]+\])?/ - "entry" in
let sto_to_eol = store /[^\n]*[^ \t\n]/ in
[ key key_re . sep_eq . sto_to_eol . eol ]
(* View: - prefix of an entry *)
let prefix = [ label "prefix" . store entry_prefix ]
(* View: minute *)
let minute = [ label "minute" . store num ]
(* View: hour *)
let hour = [ label "hour" . store num ]
(* View: dayofmonth *)
let dayofmonth = [ label "dayofmonth" . store num ]
(* View: month *)
let month = [ label "month" . store alphanum ]
(* View: dayofweek *)
let dayofweek = [ label "dayofweek" . store alphanum ]
(* View: user *)
let user = [ label "user" . store Rx.word ]
(************************************************************************
* View: time
* Time in the format "minute hour dayofmonth month dayofweek"
*************************************************************************)
let time = [ label "time" .
minute . sep_spc . hour . sep_spc . dayofmonth
. sep_spc . month . sep_spc . dayofweek ]
(* Variable: the valid values for schedules *)
let schedule_re = "reboot" | "yearly" | "annually" | "monthly"
| "weekly" | "daily" | "midnight" | "hourly"
(************************************************************************
* View: schedule
* Time in the format "@keyword"
*************************************************************************)
let schedule = [ label "schedule" . Util.del_str "@"
. store schedule_re ]
(************************************************************************
* View: entry
* A crontab entry
*************************************************************************)
let entry = [ label "entry" . indent
. prefix?
. ( time | schedule )
. sep_spc . user
. sep_spc . store Rx.space_in . eol ]
(*
* View: lns
* The cron lens
*)
let lns = ( empty | comment | shellvar | entry )*
(* Variable: filter *)
let filter =
incl "/etc/cron.d/*" .
incl "/etc/crontab" .
excl "/etc/cron.d/at.allow" .
excl "/etc/cron.d/at.deny" .
excl "/etc/cron.d/cron.allow" .
excl "/etc/cron.d/cron.deny" .
Util.stdexcl
let xfm = transform lns filter
|