Skip to content

Commit

Permalink
Updated docs (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minituff authored Oct 18, 2023
1 parent 20597d2 commit 470c8b7
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/advanced.md → docs/advanced/advanced.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
These exmaples used Docker Compose syntax. See the [Installation section](./installation.md#docker-compose-example) to fit them into your configuration.
These exmaples used Docker Compose syntax. See the [Installation section](../installation.md#docker-compose-example) to fit them into your configuration.

## Alternative Source Directories
Don't have all your container volumes in the same directory? That's okay, we can use Docker volume mappings to help.

!!! tip "Remember the folder naming convention"
1. The `container-name` must match the `source` and `destination` folder names.
1. You can ovveride this using [Aruguments](./arguments.md#override-source-directory).
2. You can override this using [Aruguments](../arguments.md#override-source-directory).

### Sandard and Alternative
```yaml
Expand Down Expand Up @@ -60,7 +60,7 @@ We can also remap the distination directory for any container we'd like.

!!! tip "Remember the folder naming convention"
1. The `container-name` must match the `source` and `destination` folder names.
1. You can ovveride this using [Aruguments](./arguments.md#override-destination-directory).
2. You can override this using [Aruguments](../arguments.md#override-destination-directory).

### Sandard and Alternative
```yaml
Expand Down
61 changes: 61 additions & 0 deletions docs/advanced/nfs-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Nautical itself does not have the ability to map network shares. However, it can use a network share for either the source or destination.

Commonly, we run containers on our host machine, then use an NFS share as the backup destination location. This page will give a brief overview of how to do that.

## NFS Shares On Container Host (Linux)

1. Create the NFS destination directories.
```bash
# Create mount point (1)
mkdir -p /mnt/nfs/docker_backups
```

1. The destination directories must exist before a mount can be created


2. Setup NFS mount points:
```bash
nano /etc/fstab
```
This will open a file, and here you can insert your NFS configuration:
```bash title="/etc/fstab"
# | ------------- Source -------------- | ---- Destination ---- | -------- Options ---------- |
192.168.1.10:/mnt/backups/docker_volumes /mnt/nfs/docker_backups nfs _netdev,auto,rw,async 0 0
```
<small>**Tip:** `192.168.1.10` is just an example IP address</small>

3. Apply and mount the NFS shares
```bash
mount -a
```

!!! success "A succesful `mount -a` will return *nothing* in the console"

4. Verify *read* and *write* access
```bash
cd /mnt/nfs/docker_backups
touch test.txt && rm test.txt
```

## Add Nautical Backup

The above example created a local directory of `/mnt/nfs/docker_backups` which is an NFS share pointing to `192.168.1.10:/mnt/backups/docker_volumes`.

Here is how we can use this new mount withing Nautical:
=== "Docker Compose"
```yaml hl_lines="9"
------8<------ "docker-compose-example.yml:0:9"
- /mnt/nfs/docker_backups:/app/destination #(3) <-- NFS Share
```

------8<------ "docker-example-tooltips.md"

=== "Docker Run"
```bash hl_lines="5"
------8<------ "docker-run-example.sh:0:5"
-v /mnt/nfs/docker_backups:/app/destination \ #(2)!
------8<------ "docker-run-example.sh:10:"
```

------8<------ "docker-example-tooltips.md"
11 changes: 11 additions & 0 deletions docs/advanced/remote-backups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Nautical does not provide connectivity to remote services such as S3, B2, or Google Drive. We believe there are better tools for these jobs and think it is best not to recreate them.

Here is a list of a few of our favorite solutions:

* https://kopia.io
* https://borgbackup.org
* https://restic.net
* https://duplicacy.com
* https://duplicati.com

Ideally, you would configure Nautical to create a backup at a `destination` folder, then point that folder to a remote backup solution.
6 changes: 1 addition & 5 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ Nautical Backup is designed to be a simple tool to backup your docker volumes.
Essentially, this is an automated and configurable backup tool built around [rsync](https://en.wikipedia.org/wiki/Rsync).
## Backups Made Easy

Nautical requires almost no configuration when container volumes are all in a folder matching its `container-name` within the source directory. Of course, we can use [variables](./arguments.md) to override these defaults.
Nautical requires almost no configuration when container volumes are all in a folder matching its `container-name` within the source directory. Of course, we can use [variables](./arguments.md) and [labels](./labels.md) to override these defaults.

⚓ Here is an example of an *easy-mode* configuration:

| Container Name | *Example* Source Data Directory | *Example* Desitnation Data Directory |
| -------------- | ----------------------------------- | -------------------------------------- |
| homeassistant | `/opt/docker-volumes/homeassistant` | `/mnt/nfs-share/backups/homeassistant` |
| unifi | `/opt/docker-volumes/unifi` | `/mnt/nfs-share/backups/unifi` |
| plex | `/opt/docker-volumes/plex` | `/mnt/nfs-share/backups/plex` |
| homepage | `/opt/docker-volumes/homepage` | `/mnt/nfs-share/backups/homepage` |
| traefik | `/opt/docker-volumes/traefik` | `/mnt/nfs-share/backups/traefik` |
| portainer | `/opt/docker-volumes/portainer` | `/mnt/nfs-share/backups/portainer` |
| trilium | `/opt/docker-volumes/trilium` | `/mnt/nfs-share/backups/trilium` |
| dozzle | *No data directory* | *No backup* |

Expand Down
4 changes: 2 additions & 2 deletions docs/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ nautical-backup.enable=true

- [ ] Service 1 - *Skipped* since `nautical-backup.enable` was set to `false`
- [x] Service 2 - *Backed up* since the label `nautical-backup.enable=true` was present
- [x] Service 3 - *Skipped* since no `nautical-backup.enable=true` label was found
- The [Require Label](./arguments.md#require-label) enviornment variable was either *not set* or set to `false`
- [x] Service 3 - *Backed up* since no `nautical-backup.enable=false` label was found
- The [Require Label](./arguments.md#require-label) enviornment variable was either *not set* or set to `false` for this example


=== "Example 2 (Opt in)"
Expand Down
7 changes: 5 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ nav:
- Installation: installation.md
- Variables: arguments.md
- Docker Labels: labels.md
- Advanced Usage: advanced.md
- Advanced Usage:
- Source & Destination Mappings: advanced/advanced.md
- NFS Shares: advanced/nfs-share.md
- Remote Backups: advanced/remote-backups.md
- Q & A: q-and-a.md
- Developer Documentation:
- Contributing to the Docs: docs.md
- Contributing to the Docs: docs.md


extra:
Expand Down
1 change: 1 addition & 0 deletions snippets/docker-run-example.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

docker run -d \
--name nautical-backup \
-v /var/run/docker.sock:/var/run/docker.sock \ #(1)!
Expand Down

0 comments on commit 470c8b7

Please sign in to comment.