Defined Type: cron::daily
- Defined in:
- manifests/daily.pp
Overview
Type: cron::daily
This type creates a daily 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'.
hour - The hour the cron job should fire on. Can be any valid cron hour
value.
Defaults to '0'.
environment - An array of environment variable settings.
Defaults to an empty set ([]).
user - The user the cron job should be executed as.
Defaults to 'root'.
mode - The mode to set on the created job file
Defaults to 0644.
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::daily { 'mysql_backup':
minute => '1',
hour => '3',
environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
command => 'mysqldump -u root my_db >/backups/my_db.sql',
}
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 |
# File 'manifests/daily.pp', line 37
define cron::daily (
Optional[String[1]] $command = undef,
Cron::Job_ensure $ensure = 'present',
Cron::Minute $minute = 0,
Cron::Hour $hour = 0,
Cron::Environment $environment = [],
Cron::User $user = 'root',
Cron::Mode $mode = '0644',
Optional[String] $description = undef,
) {
cron::job { $title:
ensure => $ensure,
minute => $minute,
hour => $hour,
date => '*',
month => '*',
weekday => '*',
user => $user,
environment => $environment,
mode => $mode,
command => $command,
description => $description,
}
}
|