Defined Type: cron::hourly
- Defined in:
- manifests/hourly.pp
Overview
Type: cron::hourly
This type creates an hourly cron job via a file in /etc/cron.d
Parameters:
ensure - The state to ensure this resource exists in. Can be absent, present
Defaults to 'present'
minute - The minute the cron job should fire on. Can be any valid cron
minute value.
Defaults to '0'.
environment - An array of environment variable settings.
Defaults to an empty set ([]).
mode - The mode to set on the created job file.
Defaults to 0644.
user - The user the cron job should be executed as.
Defaults to 'root'.
description - Optional short description, which will be included in the
cron job file.
Defaults to undef.
command - The command to execute.
Actions:
Requires:
Sample Usage:
cron::hourly { 'generate_puppetdoc':
minute => '1',
environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
command => 'puppet doc >/var/www/puppet_docs.mkd',
}
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 |
# File 'manifests/hourly.pp', line 33
define cron::hourly (
Optional[String[1]] $command = undef,
Cron::Job_ensure $ensure = 'present',
Cron::Minute $minute = 0,
Cron::Environment $environment = [],
Cron::User $user = 'root',
Cron::Mode $mode = '0644',
Optional[String] $description = undef,
) {
cron::job { $title:
ensure => $ensure,
minute => $minute,
hour => '*',
date => '*',
month => '*',
weekday => '*',
user => $user,
environment => $environment,
mode => $mode,
command => $command,
description => $description,
}
}
|