aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--manifests/init.pp22
-rw-r--r--templates/rdiff-check.sh.erb16
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