From 69aa6ba9b39edb68af797a89ee033c9987de4478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Inderm=C3=BChle?= Date: Tue, 6 Feb 2024 21:39:55 +0100 Subject: [PATCH 1/2] reenable restore --- docker-compose-restore.yml | 16 +++++++++++----- oberdocker-restore.sh | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docker-compose-restore.yml b/docker-compose-restore.yml index 5e4e130..a631c62 100644 --- a/docker-compose-restore.yml +++ b/docker-compose-restore.yml @@ -2,7 +2,7 @@ version: '3.2' services: restore: - build: ./volumerize + image: blacklabelops/volumerize:1.7.1 container_name: restore environment: - VOLUMERIZE_SOURCE=/source @@ -12,8 +12,14 @@ services: - TZ=Europe/Berlin - AWS_ACCESS_KEY_ID= ${BACKUP_AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${BACKUP_AWS_SECRET_ACCESS_KEY} - - VOLUMERIZE_DUPLICITY_OPTIONS=--file-prefix-archive=archive- + - VOLUMERIZE_DUPLICITY_OPTIONS=--file-prefix-archive=archive- --verbosity=INFO --s3-use-new-style --s3-multipart-chunk-size 50 volumes: - - /var/run/docker.sock:/var/run/docker.sock - - db:/source/db - - nextcloud:/source/nextcloud \ No newline at end of file + - type: bind + source: /var/run/docker.sock + target: /var/run/docker.sock + - type: volume + source: db + target: /source/db + - type: volume + source: nextcloud + target: /source/nextcloud \ No newline at end of file diff --git a/oberdocker-restore.sh b/oberdocker-restore.sh index 6853542..b465534 100755 --- a/oberdocker-restore.sh +++ b/oberdocker-restore.sh @@ -33,7 +33,7 @@ fi NO_RESTORE=false docker-compose \ --file docker-compose.yml \ --file docker-compose-backup.yml \ - run volumerize restore || exit 1 + run volumerize restore $@ || exit 1 if [[ $COMPOSE_PROJECT_NAME = "oberdocker" ]]; then From c8fd74a1cec806a4c3c2b0f5f5f945df3f8a7dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Inderm=C3=BChle?= Date: Tue, 6 Feb 2024 22:59:20 +0100 Subject: [PATCH 2/2] reenable restore --- README.md | 7 +++++-- oberdocker-restore.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 396ab2d..1da8890 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,10 @@ The backup is executed by a cronjob that is specified in the `docker-compose-bac You must specify the project by prepending the command with `COMPOSE_PROJECT_NAME=$projectname `. Having a project name set, prefixes all container and volume names, such that it can run beside _prod_. - *Example: * `./oberdocker-restore.sh -p restore up` + +*Example: * `./oberdocker-restore.sh -p restore up` +- - If you choose it different from 'oberdocker', the recovery is done on separate volumes and a parallel project is starter afterwards, where you can analyse the backup. -- If you choose it 'oberdocker', the recovery will be done for the relevant (productive) volumes. This will overwrite the data there. \ No newline at end of file +- If you choose it 'oberdocker', the recovery will be done for the relevant (productive) volumes. This will overwrite the data there. +- To restore a specific Time in the past, you can add the option -t see [https://duplicity.nongnu.org/vers7/duplicity.1.html#sect8] \ No newline at end of file diff --git a/oberdocker-restore.sh b/oberdocker-restore.sh index b465534..caf4ef9 100755 --- a/oberdocker-restore.sh +++ b/oberdocker-restore.sh @@ -21,7 +21,7 @@ if [[ $COMPOSE_PROJECT_NAME = "oberdocker" ]] ; then exit 0 fi else - echo The compose project name is set to '$COMPOSE_PROJECT_NAME'. + echo The compose project name is set to $COMPOSE_PROJECT_NAME. echo The data will be written to volumes prefixed with $COMPOSE_PROJECT_NAME read -p "Should we proceed? Y or N?: " -n 1 -r echo