Imported Upstream version 1.7.0
[platform/upstream/augeas.git] / lenses / cron_user.aug
1 (*
2 Module: Cron_User
3  Parses /var/spool/cron/*
4
5 Author: David Lutterkort <lutter@watzmann.net>
6
7 About: Reference
8  This lens parses the user crontab files in /var/spool/cron. It produces
9  almost the same tree as teh Cron.lns, except that it never contains a user
10  field.
11
12 About: License
13   This file is licensed under the LGPL v2+, like the rest of Augeas.
14
15 About: Lens Usage
16   Sample usage of this lens in augtool
17
18     * Get the entry that launches '/usr/bin/ls'
19       >  match '/files/var/spool/cron/foo/entry[. = "/usr/bin/ls"]'
20
21 About: Configuration files
22   This lens applies to /var/spool/cron*. See <filter>.
23  *)
24 module Cron_User =
25   autoload xfm
26
27 (************************************************************************
28  * View: entry
29  *   A crontab entry for a user's crontab
30  *************************************************************************)
31 let entry        = [ label "entry" . Cron.indent
32                    . Cron.prefix?
33                    . ( Cron.time | Cron.schedule )
34                    . Cron.sep_spc . store Rx.space_in . Cron.eol ]
35
36 (*
37  * View: lns
38  *   The cron_user lens. Almost identical to Cron.lns
39  *)
40 let lns = ( Cron.empty | Cron.comment | Cron.shellvar | entry )*
41
42 let filter =
43   incl "/var/spool/cron/*" .
44   Util.stdexcl
45
46 let xfm = transform lns filter