~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to lib/puppet/type/cron.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
require 'puppet/util/filetype'
4
4
 
5
5
Puppet::Type.newtype(:cron) do
6
 
  @doc = "Installs and manages cron jobs.  All fields except the command
7
 
    and the user are optional, although specifying no periodic
8
 
    fields would result in the command being executed every
9
 
    minute.  While the name of the cron job is not part of the actual
10
 
    job, it is used by Puppet to store and retrieve it.
 
6
  @doc = <<-EOT
 
7
    Installs and manages cron jobs.  Every cron resource requires a command
 
8
    and user attribute, as well as at least one periodic attribute (hour,
 
9
    minute, month, monthday, weekday, or special).  While the name of the cron
 
10
    job is not part of the actual job, it is used by Puppet to store and
 
11
    retrieve it.
11
12
 
12
13
    If you specify a cron job that matches an existing job in every way
13
14
    except name, then the jobs will be considered equivalent and the
18
19
    Example:
19
20
 
20
21
        cron { logrotate:
21
 
          command => \"/usr/sbin/logrotate\",
 
22
          command => "/usr/sbin/logrotate",
22
23
          user => root,
23
24
          hour => 2,
24
25
          minute => 0
25
26
        }
26
27
 
27
 
    Note that all cron values can be specified as an array of values:
 
28
    Note that all periodic attributes can be specified as an array of values:
28
29
 
29
30
        cron { logrotate:
30
 
          command => \"/usr/sbin/logrotate\",
 
31
          command => "/usr/sbin/logrotate",
31
32
          user => root,
32
33
          hour => [2, 4]
33
34
        }
34
35
 
35
 
    Or using ranges, or the step syntax `*/2` (although there's no guarantee that
36
 
    your `cron` daemon supports it):
 
36
    ...or using ranges or the step syntax `*/2` (although there's no guarantee
 
37
    that your `cron` daemon supports these):
37
38
 
38
39
        cron { logrotate:
39
 
          command => \"/usr/sbin/logrotate\",
 
40
          command => "/usr/sbin/logrotate",
40
41
          user => root,
41
42
          hour => ['2-4'],
42
43
          minute => '*/10'
43
44
        }
44
 
    "
 
45
  EOT
45
46
  ensurable
46
47
 
47
48
  # A base class for all of the Cron parameters, since they all have