aboutsummaryrefslogtreecommitdiff
path: root/templates/rdiff-check.sh.erb
blob: a2052ff75f1f1421aff98d0f1eab6c1f519d0d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#
# Check rdiff backup sets.
#

BACKUP_FOLDER="<%= backupdir_remote %>"

if [ -e "$BACKUP_FOLDER" ]; then
  cwd="`pwd`"
  cd $BACKUP_FOLDER
  
  for set in `find -maxdepth 2 -name 'rdiff'`; do
    echo " "
    echo "Checking backup set $set..."
    echo "======================================================"
    echo " "

    rdiff-backup --list-increment-sizes $set;

    if [ -d "$set/<%= backupdir %>/duplicity" ]; then
      echo " "
      echo "Checking duplicity backup found at $set/<%= backupdir %>/duplicity..."
      echo "======================================================"
      echo " "
      duplicity collection-status file:///$BACKUP_FOLDER/$set/<%= backupdir %>/duplicity
    fi
  done
  
  cd $cwd
fi