-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapper_verify
executable file
·51 lines (41 loc) · 1.45 KB
/
snapper_verify
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
source /etc/backup.conf
if test -f $CMD_DUPLICITY;
then
echo ""
OIFS=$IFS
lvscantext=`lvscan`
datum=`cat /srv/storage/backup/lastbackup.txt`
datumzeit="$(date +%Y-%m-%d-%H-%M-%S)"
PROBLEM="false"
IFS=$'\n'
echo $datum
i=0
echo "-------------------------------------------------"
echo "-------------------------------------------------"
echo "----- BACKUP-JOB $datumzeit ------------"
echo "-------------------------------------------------"
for zeile in $lvscantext
do
i=$[$i+1]
echo $zeile
ACTIVE=`echo $zeile | awk -v FS=" " '{print $1}'`
LV=`echo $zeile | awk -v FS="'" '{print $2}'`
LVname=`echo $LV | sed "s:/:_:g" | sed "s:_::"`
LVname=`echo $LV | awk -v FS="/" '{print $NF}'`
VGname=`echo $LV | sed "s:/${LVname}::"`
if [ $ACTIVE == "ACTIVE" ];
then
echo "Backup $LVname:"
echo "-------------------------------------------------"
echo "=> Verify"
# Verify
$CMD_DUPLICITY verify ftp://${FTP_USER}@${FTP_SERVER}/vm-images/${LVname} /srv/storage/backup/images/${datum}-${LVname}.img.gz
echo "-------------------------------------------------"
fi
done
IFS=$OIFS
else
echo "duplicity was not found. please correct path-"
echo "duplicity was not found. please correct path-" | mail -s "duplicity not found @ `hostname`!" $KONTAKTADRESSE
fi