.
This commit is contained in:
42
README.md
42
README.md
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- [container image](#container-image)
|
- [container image](#container-image)
|
||||||
- [environment variables](#environment-variables)
|
- [environment variables](#environment-variables)
|
||||||
- [borg repo init](#borg-repo-init)
|
- [borg init repo](#borg-init-repo)
|
||||||
- [creating a backup](#creating-a-backup)
|
- [creating a backup](#creating-a-backup)
|
||||||
- [using a bash script](#using-a-bash-script)
|
- [using a bash script](#using-a-bash-script)
|
||||||
- [dev](#dev)
|
- [dev](#dev)
|
||||||
@@ -15,40 +15,34 @@
|
|||||||
|
|
||||||
<https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables>
|
<https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables>
|
||||||
|
|
||||||
### borg repo init
|
### borg init repo
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
services:
|
services:
|
||||||
borg-backup:
|
borg-backup:
|
||||||
image: git.limbosolutions.com/kb/borg-backup:latest
|
image: git.limbosolutions.com/kb/borg-backup:latest
|
||||||
restart: no
|
restart: no
|
||||||
tty: true
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- BORG_REPO: ssh://user@server/home/user/borg-repo
|
- BORG_REPO=${BORG_REPO}
|
||||||
- BORG_RSH: "-o StrictHostKeyChecking=no -o LogLevel=ERROR"
|
- BORG_RSH=${BORG_RSH}
|
||||||
|
- BORG_PASSPHRASE="${BORG_PASSPHRASE}"
|
||||||
|
- MODE=SCRIPT # Valid modes are: BORG, SCRIPT, SHELL, default is BORG
|
||||||
configs:
|
configs:
|
||||||
- source: id_ed25519 # required for ssh client
|
|
||||||
target: /root/.ssh/id_ed25519
|
- source: id_ed25519
|
||||||
- source: borg_init_repo_sh
|
target: /root/.ssh/id_ed25519
|
||||||
target: /init-repo
|
mode: 0400
|
||||||
|
|
||||||
|
command:
|
||||||
|
- |
|
||||||
|
borg init --encryption=keyfile-blake2 $BORG_REPO
|
||||||
|
cat /root/.config/borg/keys/*
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
borg_init_repo_sh:
|
|
||||||
# Example, execute
|
|
||||||
# borg init --encryption=keyfile-blake2 $BORG_REPO
|
|
||||||
# don't forget to copy key file content on borg folder (/root/.borg/keys/*) and BORG_PASSPHRASE used during initialization
|
|
||||||
content:
|
|
||||||
while true; do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
id_ed25519:
|
id_ed25519:
|
||||||
content: |
|
file: ~/.ssh/id_ed25519
|
||||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
|
||||||
**************
|
|
||||||
**************
|
|
||||||
-----END OPENSSH PRIVATE KEY-----
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### creating a backup
|
### creating a backup
|
||||||
@@ -182,7 +176,7 @@ For development environment and testing this docker compose files.
|
|||||||
BUILD=""
|
BUILD=""
|
||||||
|
|
||||||
# uncomment do force build
|
# uncomment do force build
|
||||||
#BUILD="--build"
|
BUILD="--build"
|
||||||
|
|
||||||
if [ ! -f ./docker-compose.dev.local.yaml ]; then
|
if [ ! -f ./docker-compose.dev.local.yaml ]; then
|
||||||
touch ./docker-compose.dev.local.yaml
|
touch ./docker-compose.dev.local.yaml
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- BORG_REPO="${BORG_REPO}"
|
- BORG_REPO=${BORG_REPO}
|
||||||
- BORG_RSH="${BORG_RSH}"
|
- BORG_RSH=${BORG_RSH}
|
||||||
- BORG_PASSPHRASE="${BORG_PASSPHRASE}"
|
- BORG_PASSPHRASE="${BORG_PASSPHRASE}"
|
||||||
- MODE=SCRIPT # Valid modes are: BORG, SCRIPT, SHELL, default is BORG
|
- MODE=SCRIPT # Valid modes are: BORG, SCRIPT, SHELL, default is BORG
|
||||||
configs:
|
configs:
|
||||||
|
|||||||
Reference in New Issue
Block a user