rewrites the whole thing

This commit is contained in:
Jean-Christophe Vanhalle
2023-08-14 14:48:47 +02:00
parent 222d86a909
commit b47876ad62
19 changed files with 407 additions and 139 deletions

27
backup.sh Executable file
View File

@@ -0,0 +1,27 @@
#! /bin/sh
#
if [ ! -f "${PWD}/.env" ]; then
echo "missing env file in ${PWD}"
exit 1
fi
set -a
. "${PWD}/.env"
set +a
now="$(date +%Y-%m_%d-%H-%M-%S)"
backup_path="${PWD}/backup-volumes/${now}"
mkdir -p "${backup_path}"
volumes="db traefik-dynamic traefik-certs traefik-logs traefik-static webroot"
for volume in ${volumes}; do
mkdir -p "${backup_path}/${volume}"
docker run \
--rm \
--volume "${backup_path}/${volume}":/destination \
--volume "${PREFIX}-${volume}:/${volume}" \
ubuntu \
tar -cvzf "/destination/${volume}.tar.gz" -C "/${volume}" .
done