1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2025-09-13 15:59:28 +00:00

update README

This commit is contained in:
Norbert Varzariu
2016-01-22 14:07:06 +01:00
parent 8ba0042a94
commit eb643443fd
3 changed files with 100 additions and 40 deletions

View File

@@ -169,8 +169,14 @@ class rsnapshot::config (
# create cron files for each backup level
# merge possible cron definitions to one
$real_cron = deep_merge($rsnapshot::params::cron, $rsnapshot::cron, $hash[cron])
concat::fragment { "mailto for $host":
content => "#This file is managed by puppet\nMAILTO=${real_cron[mailto]}\n\n",
target => $cronfile,
order => 1,
}
$backup_levels.each |String $level| {
$mailto = $real_cron[mailto]
$minute = rand_from_array($real_cron[$level][minute], "${host}.${level}.minute")
$hour = rand_from_array($real_cron[$level][hour], "${host}.${level}.hour")
$monthday = rand_from_array($real_cron[$level][monthday], "${host}.${level}.monthday")
@@ -180,6 +186,7 @@ class rsnapshot::config (
concat::fragment { "${host}.${level}":
target => $cronfile,
content => template('rsnapshot/cron.erb'),
order => 2,
}
}
}

View File

@@ -63,6 +63,7 @@ class rsnapshot::params {
}
$config_backup_scripts = {}
$cron = {
mailto => 'admin@example.com',
hourly => {
minute => '0..59',
hour => '*', # you could also do: ['21..23','0..4','5'],