mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-22 13:20:29 +01:00
Merge pull request #4 from offen/stop-label
Allow for making container stop filter configurable
This commit is contained in:
commit
57afad5727
10
README.md
10
README.md
@ -53,6 +53,16 @@ AWS_S3_BUCKET_NAME="<xxx>"
|
|||||||
|
|
||||||
# GPG_PASSPHRASE="<xxx>"
|
# GPG_PASSPHRASE="<xxx>"
|
||||||
|
|
||||||
|
########### STOPPING CONTAINERS DURING BACKUP
|
||||||
|
|
||||||
|
# Containers can be stopped by applying a
|
||||||
|
# `docker-volume-backup.stop-during-backup` label. By default, all containers
|
||||||
|
# that are labeled with `true` will be stopped. If you need more fine grained
|
||||||
|
# control (e.g. when running multiple containers based on this image), you can
|
||||||
|
# override this default by specifying a different value here.
|
||||||
|
|
||||||
|
# BACKUP_STOP_CONTAINER_LABEL="service1"
|
||||||
|
|
||||||
########### MINIO CLIENT CONFIGURATION
|
########### MINIO CLIENT CONFIGURATION
|
||||||
|
|
||||||
# Pass these additional flags to all MinIO client `mc` invocations.
|
# Pass these additional flags to all MinIO client `mc` invocations.
|
||||||
|
@ -19,7 +19,7 @@ if [ -S "$DOCKER_SOCK" ]; then
|
|||||||
TEMPFILE="$(mktemp)"
|
TEMPFILE="$(mktemp)"
|
||||||
docker ps \
|
docker ps \
|
||||||
--format "{{.ID}}" \
|
--format "{{.ID}}" \
|
||||||
--filter "label=docker-volume-backup.stop-during-backup=true" \
|
--filter "label=docker-volume-backup.stop-during-backup=$BACKUP_STOP_CONTAINER_LABEL" \
|
||||||
> "$TEMPFILE"
|
> "$TEMPFILE"
|
||||||
CONTAINERS_TO_STOP="$(cat $TEMPFILE | tr '\n' ' ')"
|
CONTAINERS_TO_STOP="$(cat $TEMPFILE | tr '\n' ' ')"
|
||||||
CONTAINERS_TO_STOP_TOTAL="$(cat $TEMPFILE | wc -l)"
|
CONTAINERS_TO_STOP_TOTAL="$(cat $TEMPFILE | wc -l)"
|
||||||
|
@ -22,6 +22,8 @@ AWS_ENDPOINT="${AWS_ENDPOINT:-s3.amazonaws.com}"
|
|||||||
|
|
||||||
GPG_PASSPHRASE="${GPG_PASSPHRASE:-}"
|
GPG_PASSPHRASE="${GPG_PASSPHRASE:-}"
|
||||||
|
|
||||||
|
BACKUP_STOP_CONTAINER_LABEL="${BACKUP_STOP_CONTAINER_LABEL:-true}"
|
||||||
|
|
||||||
MC_GLOBAL_OPTIONS="${MC_GLOBAL_OPTIONS:-}"
|
MC_GLOBAL_OPTIONS="${MC_GLOBAL_OPTIONS:-}"
|
||||||
EOF
|
EOF
|
||||||
chmod a+x env.sh
|
chmod a+x env.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user