Skip to content
Snippets Groups Projects

skip couchdb backup if seq id is ureadable

Merged Hahn Axel (hahn) requested to merge message-on-no-sequenceid-couchdb2 into master
1 file
+ 28
23
Compare changes
  • Side-by-side
  • Inline
+ 28
23
@@ -4,7 +4,11 @@
# LOCALDUMP :: COUCHDB2 - using nodejs tools couchbackup and couchrestore
# https://github.com/cloudant/couchbackup
#
# creates gzipped plain text backups (JSON) from each scheme
# Backup:
# - creates gzipped plain text backups (JSON) from each scheme
# - write sequence id into a text file
# - store extra file with security infos
# - latest backup set is written to archive
#
# --------------------------------------------------------------------------------
# ah - Axel Hahn <axel.hahn@iml.unibe.ch>
@@ -22,6 +26,7 @@
# 2022-04-21 v1.7 restore security infos
# 2022-10-07 ah v1.8 unescape regex with space to prevent "grep: warning: stray \ before white space"
# 2023-06-06 ah v1.9 show a warning if the sequence id was not fetched
# 2023-06-12 ah v1.10 skip couchdb dump if no sequence id was detected (=db deleted since fetching list of all dbs)
# ================================================================================
if [ -z "$BACKUP_TARGETDIR" ]; then
@@ -223,7 +228,6 @@ function _doBackupOfSingleInstance(){
echo "WARNING: unable to fetch current sequence ID - maybe the database was deleted."
else
echo
fi
echo "update_seq --+-- current [${sSequenceCurrent}]"
echo " +-- backup [${sSequenceLast}]"
echo -n "Need to backup ... "
@@ -247,7 +251,8 @@ function _doBackupOfSingleInstance(){
fi
ls -l "$OUTFILE"*
echo
fi
fi # if [ -z "$sSequenceCurrent" ]; then
fi # if [ "${sSequenceCurrent}" = "${sSequenceLast}" ] ...
done
rm -f "$dblist"
echo "__DB__$SERVICENAME backup INFO: ${COUCHDB_INSTANCE} - backed up $iDbCount dbs of $iDbTotal total"
Loading