cron
: This class wraps cron::install for ease of usecron::install
: This class ensures that the distro-appropriate cron package is installed. This class should not be used directly under normal circumstances. Instead, use the cron class.cron::service
: This class managed the cron service. This class should not be used directly under normal circumstances. Instead, use the cron class.
cron::daily
: This type creates a daily cron job via a file in /etc/cron.dcron::hourly
: This type creates an hourly cron job via a file in /etc/cron.dcron::job
: This type creates a cron job via a file in /etc/cron.dcron::job::multiple
: This type creates multiple cron jobs via a single file in /etc/cron.d/cron::monthly
: This type creates a monthly cron job via a file in /etc/cron.dcron::weekly
: This type creates a cron job via a file in /etc/cron.d
-
Cron::Date
: Valid $date (day of month) parameter to Cron::Job. -
Cron::Deb_version
: Valid .deb version string. See https://www.debian.org/doc/debian-policy/#s-f-version -
Cron::Environment
: Valid $environment parameter to Cron::Job. -
Cron::Hour
: Valid $hour parameter to Cron::Job. -
Cron::Job_ensure
: Valid $ensure parameter to Cron::Job. -
Cron::Jobname
: Valid$title parameter to Cron::Job. This is the name of the /etc/cron.d/ file. The Ubuntu run-parts manpage specifies (^[a-zA-Z0-9_-]+$ ). Fo -
Cron::Minute
: Valid $minute parameter to Cron::Job. -
Cron::Mode
: Valid $mode parameter to Cron::Job. -
Cron::Month
: Valid $month parameter to Cron::Job. -
Cron::Monthname
: Short-names for each month. -
Cron::Package_ensure
: Valid $service_ensure parameter to Cron. -
Cron::Package_state
: Valid $ensure parameter to Package resource. Excludes version numbers. -
Cron::Rpm_version
: Valid .rpm version string. See http://www.perlmonks.org/?node_id=237724 -
Cron::Run_parts
: Valid element of $crontab_run_parts parameter to Class['cron']. -
Cron::Second
: Valid $second parameter to Cron::Job. -
Cron::Service_Enable
: Valid $service_enable parameter to Cron. -
Cron::Service_ensure
: Valid $service_ensure parameter to Cron. -
Cron::Special
: Valid $special parameter to Cron::Job. -
Cron::User
: Valid $user parameter to Cron::Job. -
Cron::Weekday
: Valid $weekday parameter to Cron::Job. -
Cron::Weekdayname
: Short names for each day of the week.
This class wraps cron::install for ease of use
include cron
class { 'cron':
manage_package => false,
}
The following parameters are available in the cron
class:
service_name
package_name
manage_package
manage_service
service_ensure
service_enable
users_allow
users_deny
manage_users_allow
manage_users_deny
allow_deny_mode
merge
manage_crontab
crontab_shell
crontab_path
crontab_mailto
crontab_home
crontab_run_parts
package_ensure
Data type: String[1]
Can be set to define a different cron service name.
Data type: String[1]
Can be set to install a different cron package.
Data type: Boolean
Can be set to disable package installation.
Default value: true
Data type: Boolean
Defines if puppet should manage the service.
Default value: true
Data type: Cron::Service_ensure
Defines if the service should be running.
Default value: 'running'
Data type: Cron::Service_enable
Defines if the service should be enabled at boot.
Default value: true
Data type: Array[Cron::User]
A list of users which are exclusively able to create, edit, display, or remove crontab files. Only used if manage_users_allow == true.
Default value: []
Data type: Array[Cron::User]
A list of users which are prohibited from create, edit, display, or remove crontab files. Only used if manage_users_deny == true.
Default value: []
Data type: Boolean
If the /etc/cron.allow should be managed.
Default value: false
Data type: Boolean
If the /etc/cron.deny should be managed.
Default value: false
Data type: Cron::Mode
Specify the cron.allow/deny file mode.
Default value: '0644'
Data type: Enum['deep', 'first', 'hash', 'unique']
The lookup()
merge method to use with cron job hiera lookups.
Default value: 'hash'
Data type: Boolean
Whether to manage /etc/crontab
Default value: false
Data type: Stdlib::Absolutepath
The value for SHELL in /etc/crontab
Default value: '/bin/bash'
Data type: String[1]
The value for PATH in /etc/crontab
Default value: '/sbin:/bin:/usr/sbin:/usr/bin'
Data type: String[1]
The value for MAILTO in /etc/crontab
Default value: 'root'
Data type: Optional[Stdlib::Absolutepath]
The value for HOME in /etc/crontab
Default value: undef
Data type: Cron::Run_parts
Define sadditional cron::run_parts resources
Default value: {}
Data type: Cron::Package_ensure
Default value: 'installed'
This class ensures that the distro-appropriate cron package is installed. This class should not be used directly under normal circumstances. Instead, use the cron class.
This class managed the cron service. This class should not be used directly under normal circumstances. Instead, use the cron class.
This type creates a daily cron job via a file in /etc/cron.d
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',
}
The following parameters are available in the cron::daily
defined type:
Data type: Optional[String[1]]
The command to execute.
Default value: undef
Data type: Cron::Job_ensure
The state to ensure this resource exists in. Can be absent, present.
Default value: 'present'
Data type: Cron::Minute
The minute the cron job should fire on. Can be any valid cron.
Default value: 0
Data type: Cron::Hour
The hour the cron job should fire on. Can be any valid cron hour value.
Default value: 0
Data type: Cron::Environment
An array of environment variable settings.
Default value: []
Data type: Cron::User
The user the cron job should be executed as.
Default value: 'root'
Data type: Cron::Mode
The mode to set on the created job file.
Default value: '0600'
Data type: Optional[String]
Optional short description, which will be included in the cron job file.
Default value: undef
This type creates an hourly cron job via a file in /etc/cron.d
cron::hourly { 'generate_puppetdoc':
minute => '1',
environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
command => 'puppet doc >/var/www/puppet_docs.mkd',
}
The following parameters are available in the cron::hourly
defined type:
Data type: Optional[String[1]]
The command to execute.
Default value: undef
Data type: Cron::Job_ensure
The state to ensure this resource exists in. Can be absent, present.
Default value: 'present'
Data type: Cron::Minute
The minute the cron job should fire on. Can be any valid cron.
Default value: 0
Data type: Cron::Environment
An array of environment variable settings.
Default value: []
Data type: Cron::User
The user the cron job should be executed as.
Default value: 'root'
Data type: Cron::Mode
The mode to set on the created job file.
Default value: '0600'
Data type: Optional[String]
Optional short description, which will be included in the cron job file.
Default value: undef
This type creates a cron job via a file in /etc/cron.d
cron::job { 'generate_puppetdoc':
minute => '01',
environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
command => 'puppet doc /etc/puppet/modules >/var/www/puppet_docs.mkd',
}
The following parameters are available in the cron::job
defined type:
Data type: Optional[String[1]]
The command to execute.
Default value: undef
Data type: Cron::Job_ensure
The state to ensure this resource exists in. Can be absent, present.
Default value: 'present'
Data type: Cron::Minute
The minute the cron job should fire on. Can be any valid cron.
Default value: '*'
Data type: Cron::Hour
The hour the cron job should fire on. Can be any valid cron hour.
Default value: '*'
Data type: Cron::Date
The date the cron job should fire on. Can be any valid cron date.
Default value: '*'
Data type: Cron::Month
The month the cron job should fire on. Can be any valid cron month.
Default value: '*'
Data type: Cron::Weekday
The day of the week the cron job should fire on. Can be any valid cron weekday value.
Default value: '*'
Data type: Cron::Special
A crontab specific keyword like 'reboot'.
Default value: undef
Data type: Cron::Environment
An array of environment variable settings.
Default value: []
Data type: Cron::User
The user the cron job should be executed as.
Default value: 'root'
Data type: Cron::Mode
The mode to set on the created job file.
Default value: '0600'
Data type: Optional[String]
Optional short description, which will be included in the cron job file.
Default value: undef
This type creates multiple cron jobs via a single file in /etc/cron.d/
cron::job::multiple { 'test':
jobs => [
{
minute => '55',
hour => '5',
date => '*',
month => '*',
weekday => '*',
user => 'rmueller',
command => '/usr/bin/uname',
},
{
command => '/usr/bin/sleep 1',
},
{
command => '/usr/bin/sleep 10',
special => 'reboot',
},
],
environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
}
The following parameters are available in the cron::job::multiple
defined type:
Data type: Array[Struct[{ Optional['command'] => String[1], Optional['minute'] => Cron::Minute, Optional['hour'] => Cron::Hour, Optional['date'] => Cron::Date, Optional['month'] => Cron::Month, Optional['weekday'] => Cron::Weekday, Optional['special'] => Cron::Special, Optional['environment'] => Cron::Environment, Optional['user'] => Cron::User, Optional['description'] => String, }]]
A hash of multiple cron jobs using the same structure as cron::job and using the same defaults for each parameter.
Data type: Cron::Job_ensure
The state to ensure this resource exists in. Can be absent, present.
Default value: 'present'
Data type: Cron::Environment
An array of environment variable settings.
Default value: []
Data type: Cron::Mode
The mode to set on the created job file.
Default value: '0600'
This type creates a monthly cron job via a file in /etc/cron.d
cron::monthly { 'delete_old_log_files':
minute => '1',
hour => '7',
date => '28',
environment => [ 'MAILTO="[email protected]"' ],
command => 'find /var/log -type f -ctime +30 -delete',
}
The following parameters are available in the cron::monthly
defined type:
Data type: Optional[String[1]]
The command to execute.
Default value: undef
Data type: Cron::Job_ensure
The state to ensure this resource exists in. Can be absent, present.
Default value: 'present'
Data type: Cron::Minute
The minute the cron job should fire on. Can be any valid cron value.
Default value: 0
Data type: Cron::Hour
The hour the cron job should fire on. Can be any valid cron hour value.
Default value: 0
Data type: Cron::Date
The date the cron job should fire on. Can be any valid cron date value.
Default value: 1
Data type: Cron::Environment
An array of environment variable settings.
Default value: []
Data type: Cron::User
The user the cron job should be executed as.
Default value: 'root'
Data type: Cron::Mode
The mode to set on the created job file.
Default value: '0600'
Data type: Optional[String]
Optional short description, which will be included in the cron job file.
Default value: undef
This type creates a cron job via a file in /etc/cron.d
cron::weekly { 'delete_old_temp_files':
minute => '1',
hour => '4',
weekday => '7',
environment => [ 'MAILTO="[email protected]"' ],
command => 'find /tmp -type f -ctime +7 -delete',
}
The following parameters are available in the cron::weekly
defined type:
Data type: Optional[String[1]]
The command to execute.
Default value: undef
Data type: Cron::Job_ensure
The state to ensure this resource exists in. Can be absent, present.
Default value: 'present'
Data type: Cron::Minute
The minute the cron job should fire on. Can be any valid cron.
Default value: 0
Data type: Cron::Hour
The hour the cron job should fire on. Can be any valid cron hour value.
Default value: 0
Data type: Cron::Weekday
The day of the week the cron job should fire on. Can be any valid cron weekday value.
Default value: 0
Data type: Cron::User
The user the cron job should be executed as.
Default value: 'root'
Data type: Cron::Mode
The mode to set on the created job file.
Default value: '0600'
Data type: Cron::Environment
An array of environment variable settings.
Default value: []
Data type: Optional[String]
Optional short description, which will be included in the cron job file.
Default value: undef
Valid $date (day of month) parameter to Cron::Job.
Alias of
Variant[Integer[1,31], Pattern[/(?x)\A(
\* ( \/ ( [12][0-9]?|3[01]?|[4-9] ) )?
| ( [12][0-9]?|3[01]?|[4-9] ) ( - ( [12][0-9]?|3[01]?|[4-9] ) ( \/ ( [12][0-9]?|3[01]?|[4-9] ) )? )?
( , ( [12][0-9]?|3[01]?|[4-9] ) ( - ( [12][0-9]?|3[01]?|[4-9] ) ( \/ ( [12][0-9]?|3[01]?|[4-9] ) )? )? )*
)\z/]]
Valid .deb version string. See https://www.debian.org/doc/debian-policy/#s-f-version
Alias of
Pattern[/(?i:\A(((0|[1-9][0-9]*):)?[0-9]([a-z0-9.+-~]*|[a-z0-9.+~]*-[a-z0-9+.~]+))\z)/]
Valid $environment parameter to Cron::Job.
Alias of
Array[Pattern[/(?i:\A[a-z_][a-z0-9_]*=[^\0]*\z)/]]
Valid $hour parameter to Cron::Job.
Alias of
Variant[Integer[0,23], Pattern[/(?x)\A(
\* ( \/ ( 1[0-9]|2[0-3]|[1-9] ) )?
| ( 1?[0-9]|2[0-3] ) ( - ( 1?[0-9]|2[0-3] ) ( \/ ( 1[0-9]|2[0-3]|[1-9] ) )? )?
( , ( 1?[0-9]|2[0-3] ) ( - ( 1?[0-9]|2[0-3] ) ( \/ ( 1[0-9]|2[0-3]|[1-9] ) )? )? )*
)\z/]]
Valid $ensure parameter to Cron::Job.
Alias of
Enum['absent', 'present']
Valid
- Ignore files starting with "." or "#"
- Ignore the CRON_HOSTNAME file (default ".cron.hostname").
- Ignore files whose length is zero or greater than NAME_MAX (default 255).
- Ignore files whose name ends in "~".
- Ignore files whose name ends in ".rpmsave", ".rpmorig", or ".rpmnew". We will use the most restrictive combination. See http://manpages.ubuntu.com/manpages/zesty/en/man8/run-parts.8.html See https://github.com/cronie-crond/cronie/blob/master/src/database.c#L625
Alias of
Pattern[/(?i:\A[a-z0-9_-]{1,255}\z)/]
Valid $minute parameter to Cron::Job.
Alias of
Variant[Integer[0,59], Pattern[/(?x)\A(
\* ( \/ ( [1-5][0-9]?|[6-9] ) )?
| [1-5]?[0-9] ( - [1-5]?[0-9] ( \/ ( [1-5][0-9]?|[6-9] ) )? )?
( , [1-5]?[0-9] ( - [1-5]?[0-9] ( \/ ( [1-5][0-9]?|[6-9] ) )? )? )*
)\z/]]
Valid $mode parameter to Cron::Job.
Alias of
Pattern[/\A[0-7]{4}\z/]
Valid $month parameter to Cron::Job.
Alias of
Variant[Cron::Monthname, Integer[1,12], Pattern[/(?x)\A(
\* ( \/ ( 1[012]?|[2-9] ) )?
| ( 1[012]?|[2-9] ) ( - ( 1[012]?|[2-9] ) ( \/ ( 1[012]?|[2-9] ) )? )?
( , ( 1[012]?|[2-9] ) ( - ( 1[012]?|[2-9] ) ( \/ ( 1[012]?|[2-9] ) )? )? )*
)\z/]]
Short-names for each month.
Alias of
Enum['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
Valid $service_ensure parameter to Cron.
Alias of
Variant[Cron::Package_state, Cron::Deb_version, Cron::Rpm_version]
Valid $ensure parameter to Package resource. Excludes version numbers.
Alias of
Enum['absent', 'installed', 'held', 'latest', 'present', 'purged']
Valid .rpm version string. See http://www.perlmonks.org/?node_id=237724
Alias of
Pattern[/\A[^-]+(-[^-])?\z/]
Valid element of $crontab_run_parts parameter to Class['cron'].
Alias of
Hash[Cron::Jobname, Struct[{
NotUndef['user'] => Cron::User,
Optional['minute'] => Cron::Minute,
Optional['hour'] => Cron::Hour,
Optional['dayofmonth'] => Cron::Date,
Optional['month'] => Cron::Month,
Optional['dayofweek'] => Cron::Weekday,
}]]
Valid $second parameter to Cron::Job.
Alias of
Cron::Minute
Valid $service_enable parameter to Cron.
Alias of
Variant[Boolean, Enum['manual','mask']]
Valid $service_ensure parameter to Cron.
Alias of
Variant[Boolean, Enum['running','stopped']]
Valid $special parameter to Cron::Job.
Alias of
Optional[Enum['annually',
'daily',
'hourly',
'midnight',
'monthly',
'reboot',
'weekly',
'yearly',
]]
Valid $user parameter to Cron::Job.
Alias of
Pattern[/(?i:\A\w[a-z0-9_\.-]{0,30}[a-z0-9_$-]\z)/]
Valid $weekday parameter to Cron::Job.
Alias of
Variant[Cron::Weekdayname, Integer[0,7], Pattern[/(?x)\A(
\* ( \/ [1-7] )?
| [0-7] ( - [0-7] ( \/ [1-7] )? )?
( , [0-7] ( - [0-7] ( \/ [1-7] )? )? )*
)\z/]]
Short names for each day of the week.
Alias of
Enum['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']