aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/rsync-check.sh.erb29
1 files changed, 20 insertions, 9 deletions
diff --git a/templates/rsync-check.sh.erb b/templates/rsync-check.sh.erb
index 879faaf..4997cfe 100644
--- a/templates/rsync-check.sh.erb
+++ b/templates/rsync-check.sh.erb
@@ -8,18 +8,29 @@ BACKUP_FOLDER="<%= backupdir_remote %>"
if [ -e "$BACKUP_FOLDER" ]; then
cwd="`pwd`"
cd $BACKUP_FOLDER
+
+ sets="`find -maxdepth 2 -name 'rsync' 2> /dev/null`"
+ if [ -z "$sets" ]; then
+ exit
+ fi
- for set in `find -maxdepth 2 -name 'rsync'`; do
- echo " "
- echo "Checking backup set $set..."
- echo "======================================================"
- echo " "
+ for set in $sets; do
+ metadatas="`find $set -name 'created' 2> /dev/null`"
+
+ if [ ! -z "$metadatas" ] || [ -d "$set/<%= backupdir %>/duplicity" ]; then
+ echo " "
+ echo "Checking backup set $set..."
+ echo "======================================================"
+ echo " "
+ fi
# Check rsync metadata
- for metadata in `find $set -name created`; do
- echo $metadata
- cat $metadata
- done
+ if [ ! -z "$metadatas" ]; then
+ for metadata in $metadatas; do
+ echo $metadata
+ cat $metadata
+ done
+ fi
# Check duplicity metadata
if [ -d "$set/<%= backupdir %>/duplicity" ]; then