backup/restore: use MONGO_SERVICE variable for service name

This commit is contained in:
2025-08-24 08:29:01 +00:00
parent 64496b8cd8
commit 9c29838092
2 changed files with 10 additions and 4 deletions

View File

@@ -1,8 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
# Configuration
MONGO_SERVICE="utility-bills-tracker_mongo"
# scale down mongo service while we copy its volume
docker service scale utility-bills-tracker_mongo=0
docker service scale "$MONGO_SERVICE"=0
# timestamp for filename
TIMESTAMP=$(date +"%Y-%m-%d-%H-%M")
@@ -30,4 +33,4 @@ if [ "$KEEP" -gt 0 ]; then
fi
# bring mongo service back up
docker service scale utility-bills-tracker_mongo=1
docker service scale "$MONGO_SERVICE"=1