Update db-backup-standalone.sh to use docker compose
- Replace docker service scale with docker compose stop/start - Update service name from utility-bills-tracker_mongo to mongo - Reference docker-compose-standalone.yaml compose file - Update comments to reflect container operations vs swarm service 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,10 +2,11 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
MONGO_SERVICE="utility-bills-tracker_mongo"
|
MONGO_SERVICE="mongo"
|
||||||
|
COMPOSE_FILE="docker-compose-standalone.yaml"
|
||||||
|
|
||||||
# scale down mongo service while we copy its volume
|
# stop mongo container while we copy its volume
|
||||||
docker service scale "$MONGO_SERVICE"=0
|
docker compose -f "$COMPOSE_FILE" stop "$MONGO_SERVICE"
|
||||||
|
|
||||||
# timestamp for filename
|
# timestamp for filename
|
||||||
TIMESTAMP=$(date +"%Y-%m-%d-%H-%M")
|
TIMESTAMP=$(date +"%Y-%m-%d-%H-%M")
|
||||||
@@ -32,5 +33,5 @@ if [ "$KEEP" -gt 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# bring mongo service back up
|
# bring mongo container back up
|
||||||
docker service scale "$MONGO_SERVICE"=1
|
docker compose -f "$COMPOSE_FILE" start "$MONGO_SERVICE"
|
||||||
Reference in New Issue
Block a user