Check compressed MongDB dumps
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/pr Build was killed

This patch also ignores absent files to avoid errors like:

    stat: cannot stat '…': No such file or directory
This commit is contained in:
Alexis Ben Miloud--Josselin 2022-01-03 10:52:37 +01:00
parent 3fa6c082a1
commit f167a5a445

View file

@ -943,7 +943,10 @@ check_mongo_backup() {
# You could change the default path in /etc/evocheck.cf
MONGO_BACKUP_PATH=${MONGO_BACKUP_PATH:-"/home/backup/mongodump"}
if [ -d "$MONGO_BACKUP_PATH" ]; then
for file in "${MONGO_BACKUP_PATH}"/*/*.{json,bson}; do
for file in "${MONGO_BACKUP_PATH}"/*/*.{json,bson}{,.gz}; do
if ! test -f "${file}"; then
continue
fi
# Skip indexes file.
if ! [[ "$file" =~ indexes ]]; then
limit=$(date +"%s" -d "now - 2 day")