initial implementation for joplin

This commit is contained in:
John Lancaster
2024-02-04 11:05:45 -06:00
parent 4a057d050e
commit c4fd2f3623
5 changed files with 65 additions and 2 deletions

11
.autorestic.yaml Normal file
View File

@@ -0,0 +1,11 @@
version: 2
locations:
joplin:
from: /source/joplin/data
to: joplin-nfs
backends:
joplin-nfs:
type: local
path: /backups/joplin

1
.gitignore vendored
View File

@@ -1 +1,2 @@
data/
.env

View File

@@ -5,11 +5,20 @@
- Joplin data
- InfluxDB data
## Implementation
- 1 restic repo per service getting backed up
- NFS share from NAS is mounted at `/mnt/backups` into the LXC
- Reference: [[Tutorial] Mounting NFS share to an unprivileged LXC](https://forum.proxmox.com/threads/tutorial-mounting-nfs-share-to-an-unprivileged-lxc.138506/)
- Needed to create the repo with the `restic/restic` image before running the `autorestic` service
- Create at `/mnt/backups/<repo>` with `create_restic_repo.sh`
## Tools
### [restic / **restic**](https://github.com/restic/restic)
[Documentation](https://restic.readthedocs.io/en/stable/index.html)
- [Documentation](https://restic.readthedocs.io/en/stable/index.html)
- [DockerHub](https://hub.docker.com/r/restic/restic)
### [cupcakearmy / **autorestic**](https://github.com/cupcakearmy/autorestic)

16
create_restic_repo.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "$(tput setaf 1)No repo name specified$(tput sgr0)"
echo "Usage: $0 <repo name>"
exit 1
else
# Assign the directory to a variable
REPO_PATH=/mnt/backups/$1
echo -e "Creating $(tput setaf 4)$REPO_PATH$(tput sgr0)"
fi
docker run -it --rm \
-v /mnt/backups:/mnt/backups \
restic/restic \
init --repo $REPO_PATH

26
docker-compose.yml Normal file
View File

@@ -0,0 +1,26 @@
version: '3.9'
services:
autorestic:
image: cupcakearmy/autorestic:latest
env_file:
- .env
volumes:
- .autorestic.yaml:/.autorestic.yaml
- ../:/source:ro
- backups:/backups
- /var/run/docker.sock:/var/run/docker.sock
command: [
"autorestic",
"backup",
"-va",
"-c", "/.autorestic.yaml"
]
volumes:
backups:
driver: local
driver_opts:
type: none
o: bind
device: /mnt/backups