-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsync-verify-backup
executable file
·32 lines (25 loc) · 1.17 KB
/
rsync-verify-backup
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
31
32
#!/bin/bash
# Front-end script to duplicity to clean up rsync.net backups
# written by Jeff Fritz https://github.com/jfritz
# NOTE This should be run first, then the duplicity full|inc command.
# See http://www.rsync.net/resources/howto/duplicity.html
set -e # Exit if anything returns a bad return value.
set -u # Exit if we attempt to use an uninitialized variable
# Custom string, if any, for logs
LOG_BASENAME="backup-verify"
# Bring in configuration
APP_PATH=`dirname $0`
source "$APP_PATH/backups.conf"
# ---------------------- User serviceable parts stop here! ------------------------
touch $LOG_NAME
echo "Verify log at ${LOG_TIME} - ${LOG_NAME}"
echo "Doing some clean up..."
for i in $BACKUP_DIRS
do
DEST_BUCKET=`echo ${i:1} | tr '/' '-'`
DEST_URL_BASE="${DESTINATION_PATH}/${DEST_BUCKET}"
DEST="${DEST_URL_BASE}"
echo "---------- verify: ${DEST_BUCKET}-------------" | $TEE $LOG_NAME
echo "$DUPLICITY verify --verbosity notice --archive-dir="${ARCHIVE_DIR}" --encrypt-key=\"${KEY_ID}\" $DEST $i >> $LOG_NAME 2>&1" | $TEE $LOG_NAME
$DUPLICITY verify --verbosity notice --archive-dir="${ARCHIVE_DIR}" --encrypt-key="$KEY_ID" $DEST $i >> $LOG_NAME 2>&1
done