diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-02-16 10:56:38 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-02-16 10:56:38 -0200 |
commit | 7e2d2d89906b2ef31c330d3f9f0fa9cbedc3b772 (patch) | |
tree | 0f33a84bc05d19c8736f6aa2c50e2824e0e51acc | |
parent | e170c1c8b4c33e46456a109ac5d4864f1e3ea15e (diff) | |
download | puppet-backup-7e2d2d89906b2ef31c330d3f9f0fa9cbedc3b772.tar.gz puppet-backup-7e2d2d89906b2ef31c330d3f9f0fa9cbedc3b772.tar.bz2 |
Adding rdiff-check script
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | manifests/init.pp | 22 | ||||
-rw-r--r-- | templates/rdiff-check.sh.erb | 16 |
3 files changed, 38 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/manifests/init.pp b/manifests/init.pp index 6e554d1..83489f2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -50,6 +50,26 @@ class backup { ensure => absent, } + # rdiff-check script + file { "/usr/local/sbin/rdiff-check": + content => template('backup/rdiff-check.sh.erb'), + owner => root, + groupe => root, + mode => 0755, + ensure => present, + } + + # check rdiff-backups once a week + cron { "rdiff_check": + command => "/usr/local/sbin/rdiff-check", + user => root, + hour => "0", + minute => "0", + weekday => "0", + ensure => $periodic_check, + require => File['/usr/local/sbin/rdiff-check'], + } + # default backupninja::rdiff configuration define rdiff($port = '22', $ensure = present, $installkey = true) { backupninja::rdiff { "rdiff-$title.$domain": @@ -104,7 +124,7 @@ class backup { require => File["${backupninja::client::defaults::configdir}"], } - # check backups once a week + # check duplicity backups once a week cron { "duplicity_check--$title.$domain": command => "/bin/bash ${backupninja::client::defaults::configdir}/${order}_duplicity-${title}.sh --check", user => root, diff --git a/templates/rdiff-check.sh.erb b/templates/rdiff-check.sh.erb new file mode 100644 index 0000000..bfb9734 --- /dev/null +++ b/templates/rdiff-check.sh.erb @@ -0,0 +1,16 @@ +#!/bin/bash +# +# Check rdiff backup sets. +# + +BACKUP_FOLDER="<%= backupdir %>/remote" + +cwd="`pwd`" +cd $BACKUP_FOLDER + +for set in `find -maxdepth 2 -name 'rdiff'`; do + echo "Checking backup set $set..." + rdiff-backup --list-increment-sizes $set; +done + +cd $cwd |