Fixed broken db restore

This commit is contained in:
Rob Pearce 2021-06-26 11:44:36 +10:00
parent 02140f07db
commit 530daa9eaf
1 changed files with 4 additions and 2 deletions

View File

@ -1101,9 +1101,11 @@ for f in $REPO_LIST; do
RESTOREDIR="$RESTOREDIRBASE/$f/"
snaps=$(${RESTIC} snapshots $AUTHOPTS $CONNECTIONSOPTS 2>&1 | grep -v ID | awk '(NF >= 4) { print }')
if checktag "$f" postgres; then
snaps=$(echo "$snaps" | grep -v postgres)
snaps=$(echo "$snaps" | grep -w postgres)
elif checktag "$f" mysql; then
snaps=$(echo "$snaps" | grep -v mysql)
snaps=$(echo "$snaps" | grep -w mysql)
else
snaps=$(echo "$snaps" | egrep -vw "postgres|mysql")
fi
snapids=$(echo "$snaps" | awk '{ print $1 }')
defsid=$(echo "$snapids" | tail -1)