diff --git a/manifests/init.pp b/manifests/init.pp index e93f9d1..5f17c91 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,6 +20,8 @@ class rsnapshot ( $backup_levels = $rsnapshot::params::config_backup_levels, $cron_service_name = $rsnapshot::params::cron_service_name, $rsnapshot_prefix = $rsnapshot::params::config_rsnapshot_prefix, + $check_mk_job = $rsnapshot::params::config_check_mk_job, + ) inherits rsnapshot::params { $default_backup_scripts = $rsnapshot::params::backup_scripts + $backup_scripts diff --git a/manifests/params.pp b/manifests/params.pp index c5efa35..fa86a3c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -16,6 +16,7 @@ class rsnapshot::params { $config_backup_levels = [ 'daily', 'weekly', 'monthly' ] $config_backup_defaults = true $config_version = '1.2' + $config_check_mk_job = false $config_cmd_cp = '/bin/cp' $config_cmd_rm = '/bin/rm' $config_cmd_rsync = '/usr/bin/rsync' @@ -92,7 +93,7 @@ class rsnapshot::params { }, monthly => { minute => '0..59', - hour => '0..23', # you could also do: ['21..23','0..4','5'], + hour => '0..23', # you could also do: ['21..2 3','0..4','5'], monthday => '0..28', month => '*', weekday => '*', diff --git a/templates/cron.erb b/templates/cron.erb index 4c63a80..56ae348 100644 --- a/templates/cron.erb +++ b/templates/cron.erb @@ -1 +1 @@ -<%= @minute %> <%= @hour %> <%= @monthday %> <%= @month %> <%= @weekday %> root /usr/bin/rsnapshot -c <%= @config %> <%= @level %> +<%= @minute %> <%= @hour %> <%= @monthday %> <%= @month %> <%= @weekday %> root<% if scope['rsnapshot::check_mk_job'] == true -%> mk-job rsnapshot_<%= @host %>_<%= @level %><% end -%> /usr/bin/rsnapshot -c <%= @config %> <%= @level %>