Commit 8cb98581 authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'multiple-lvm-snapshots' into 'master'

Add ability to handle multiple lvm-snapshots

See merge request !25
parents f22be9ba e264c862
Pipeline #956 passed with stages
in 2 minutes and 2 seconds
......@@ -56,27 +56,37 @@ else
fi
# Loop with all LVS
for lv in "${BACKUP_LVS[@]}"
for LV in "${BACKUP_LVS[@]}"
do
ITEM_LIST=$(echo "$lv" | cut -d, -f2-)
lv="${lv//,$ITEM_LIST/}"
OLD_IFS="$IFS"
IFS=','
read -a ITEMS -r <<< "$ITEM_LIST"
read -a ITEMS -r <<< "$LV"
IFS="$OLD_IFS"
BIND_MOUNT_ARGS=()
LVM_SNAPSHOT_ARGS=()
for ITEM in "${ITEMS[@]}"
do
BIND_MOUNT_ARGS+=("--bind-mount")
BIND_MOUNT_ARGS+=("$ITEM:$ITEM")
case "$i" in
/*)
BIND_MOUNT_ARGS+=("--bind-mount")
BIND_MOUNT_ARGS+=("$ITEM:$ITEM")
;;
*)
LVM_SNAPSHOT_ARGS+=("--lvm-snapshot")
LVM_SNAPSHOT_ARGS+=("$ITEM")
;;
esac
done
ZABBIX_ITEM="$lv,$PERIOD"
if [ "${#LVM_SNAPSHOT_ARGS[@]}" -gt "2" ]
then
ZABBIX_ITEM="$PERIOD"
else
ZABBIX_ITEM="$lv,$PERIOD"
fi
# Backup to $PERIOD-$vg-$lv ...
backstep-traceback --backup \
......@@ -84,7 +94,7 @@ do
--safe \
--deltas \
--create-timestamp-file \
--lvm-snapshot "$lv" \
"${LVM_SNAPSHOT_ARGS[@]}" \
"${BIND_MOUNT_ARGS[@]}" \
--email-subject "${PERIOD^^} $lv" \
--email="$REPORT_EMAIL" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment