define backup::borg( $port = '22', $ensure = present, $keepdaily = '7', $keepweekly = '4', $keepmonthly = '3', $user = $::hostname, $host = "${title}.${::domain}", $encryption = 'repokey', $order = 95, $periodic_check = absent, $password, ) { $exclude_unencrypted = $backup::params::exclude_unencrypted $include_unencrypted = $backup::params::include_unencrypted file { "${backupninja::configdir}/${order}_borg-${host}.sh": ensure => $ensure, content => template('backup/borg.sh.erb'), owner => root, group => root, mode => '0600', require => File["${backupninja::configdir}"], } cron { "borg_check-$title.$domain": command => "/bin/bash ${backupninja::configdir}/${order}_borg-${host}.sh --check", user => root, hour => "0", minute => "0", weekday => "0", ensure => $periodic_check, } }