Commit e264c862 authored by Robert Spencer's avatar Robert Spencer

Add ability to handle multiple lvm-snapshots

parent f22be9ba
......@@ -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
case "$i" in
/*)
BIND_MOUNT_ARGS+=("--bind-mount")
BIND_MOUNT_ARGS+=("$ITEM:$ITEM")
;;
*)
LVM_SNAPSHOT_ARGS+=("--lvm-snapshot")
LVM_SNAPSHOT_ARGS+=("$ITEM")
;;
esac
done
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