Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- 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]
16 changes: 11 additions & 5 deletions docker-compose-restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.2'

services:
restore:
build: ./volumerize
image: blacklabelops/volumerize:1.7.1
container_name: restore
environment:
- VOLUMERIZE_SOURCE=/source
Expand All @@ -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
- 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
4 changes: 2 additions & 2 deletions oberdocker-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down