diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-01-03 15:38:21 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-01-03 15:38:21 -0200 |
commit | c34d2c29c3f9d1189769fd71de71e42ee9a86a4f (patch) | |
tree | 69fd15b28f7f17b14bb50a6377c55ebd711b1af2 /templates | |
parent | 60a0245da2b80753d5ae288f3a1ea3969fa81fc3 (diff) | |
download | puppet-backup-c34d2c29c3f9d1189769fd71de71e42ee9a86a4f.tar.gz puppet-backup-c34d2c29c3f9d1189769fd71de71e42ee9a86a4f.tar.bz2 |
Enhancing metadata display at rsync-check
Diffstat (limited to 'templates')
-rw-r--r-- | templates/rsync-check.sh.erb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/templates/rsync-check.sh.erb b/templates/rsync-check.sh.erb index aa1a19c..798ce5c 100644 --- a/templates/rsync-check.sh.erb +++ b/templates/rsync-check.sh.erb @@ -10,9 +10,10 @@ if [ -e "$BACKUP_FOLDER" ]; then cd $BACKUP_FOLDER for set in `find -maxdepth 2 -name 'rsync'`; do - metadatas="`find $set -name 'created' 2> /dev/null`" + created="`find $set -name 'created' 2> /dev/null | sort`" + rotated="`find $set -name 'rotated' 2> /dev/null | sort`" - if [ ! -z "$metadatas" ] || [ -d "$set/<%= backupdir %>/duplicity" ]; then + if [ ! -z "$created" ] || [ -d "$set/<%= backupdir %>/duplicity" ]; then echo " " echo "Checking backup set $set..." echo "======================================================" @@ -20,14 +21,20 @@ if [ -e "$BACKUP_FOLDER" ]; then fi # Check rsync metadata - if [ ! -z "$metadatas" ]; then + if [ ! -z "$created" ]; then echo " " echo "Available dates" echo "======================================================" echo " " - for metadata in $metadatas; do - cat $metadata + for metadata in $created; do + echo -n "$(basename `dirname $metadata`): created at " + head -1 $metadata done + + for metadata in $rotated; do + echo -n "$(basename `dirname $metadata`): rotated at " + head -1 $metadata + done fi # Check duplicity metadata |