Commit e264c862 authored by Robert Spencer's avatar Robert Spencer

Add ability to handle multiple lvm-snapshots

parent f22be9ba
...@@ -56,27 +56,37 @@ else ...@@ -56,27 +56,37 @@ else
fi fi
# Loop with all LVS # Loop with all LVS
for lv in "${BACKUP_LVS[@]}" for LV in "${BACKUP_LVS[@]}"
do do
ITEM_LIST=$(echo "$lv" | cut -d, -f2-)
lv="${lv//,$ITEM_LIST/}"
OLD_IFS="$IFS" OLD_IFS="$IFS"
IFS=',' IFS=','
read -a ITEMS -r <<< "$ITEM_LIST" read -a ITEMS -r <<< "$LV"
IFS="$OLD_IFS" IFS="$OLD_IFS"
BIND_MOUNT_ARGS=() BIND_MOUNT_ARGS=()
LVM_SNAPSHOT_ARGS=()
for ITEM in "${ITEMS[@]}" for ITEM in "${ITEMS[@]}"
do do
BIND_MOUNT_ARGS+=("--bind-mount") case "$i" in
BIND_MOUNT_ARGS+=("$ITEM:$ITEM") /*)
BIND_MOUNT_ARGS+=("--bind-mount")
BIND_MOUNT_ARGS+=("$ITEM:$ITEM")
;;
*)
LVM_SNAPSHOT_ARGS+=("--lvm-snapshot")
LVM_SNAPSHOT_ARGS+=("$ITEM")
;;
esac
done 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 ... # Backup to $PERIOD-$vg-$lv ...
backstep-traceback --backup \ backstep-traceback --backup \
...@@ -84,7 +94,7 @@ do ...@@ -84,7 +94,7 @@ do
--safe \ --safe \
--deltas \ --deltas \
--create-timestamp-file \ --create-timestamp-file \
--lvm-snapshot "$lv" \ "${LVM_SNAPSHOT_ARGS[@]}" \
"${BIND_MOUNT_ARGS[@]}" \ "${BIND_MOUNT_ARGS[@]}" \
--email-subject "${PERIOD^^} $lv" \ --email-subject "${PERIOD^^} $lv" \
--email="$REPORT_EMAIL" \ --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