Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Minituff committed Oct 9, 2023
1 parent 7e12d5c commit ec34129
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p style="text-align: center; margin-left: 1.6rem;">
<img alt="Logo" src="/media/Logo-transparent.png" width="450" />
<img alt="Logo" src="./media/Logo-transparent.png" width="450" />
</p>

<p align="center">
Expand Down
11 changes: 7 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version: '3'
services:
nautical-backup:
image: minituff/nautical-backup
image: minituff/nautical-backup:0.0.3 #(7)!
container_name: nautical-backup
hostname: nautical-backup
restart: unless-stopped
Expand All @@ -15,9 +15,8 @@ services:
- /source:/app/source #(2)!
- /destination:/app/destination #(3)!
environment:
# Optional variables (4)
- TZ=America/Los_Angeles
#(4)!
# Optional variables
- CRON_SCHEDULE=* 4 * * * #(5)!
- SKIP_CONTAINERS=example1,example2,example3 #(6)!
```
Expand All @@ -29,13 +28,15 @@ services:
5. Scheduled time to run backups. Use [this website](https://crontab.guru) to help pick a CRON schedule.
* Default = `0 4 * * *` - Every day at 4am.
6. Containers to skip. A comma seperated list.
7. It is recommended to avoid using the `latest` tag.
* This project is under active development, using a exact tag can help avoid updates breaking things.


## Docker Run Example

```bash
docker run -d \
--name nautical-backup \
--name nautical-backup:0.0.3 \ #(7)!
-v /var/run/docker.sock:/var/run/docker.sock \ #(1)!
-v /source:/app/source \ #(2)!
-v /destination:/app/destination \ #(3)!
Expand All @@ -51,5 +52,7 @@ minituff/nautical-backup
5. Scheduled time to run backups. Use [this website](https://crontab.guru) to help pick a CRON schedule.
* Default = `0 4 * * *` - Every day at 4am.
6. Containers to skip. A comma seperated list.
7. It is recommended to avoid using the `latest` tag.
* This project is under active development, using a exact tag can help avoid updates breaking things.

<br>
34 changes: 27 additions & 7 deletions docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Nautical Backup is designed to be a simple and easy way to use tool to backup your docker volumes.

### How it works
Once the CRON job triggers the script to run:

1. All running contianers will be listed by `name`
1. All running contianers will be listed by `name` and `id`
1. `source_location` and `destination_location` will be verified
* *read* permissions for the source
* *read + write* permissions for the destination
1. The container will be *skipped* if:
* The `container_name` does not match `source_location`
* The `container_name` has *no* matching `source_location`
Expand All @@ -13,17 +17,33 @@ Once the CRON job triggers the script to run:
1. A `Backup Report (today's date).txt` will be created in `destination_location`

!!! warning "The `container_name` needs the same `directory` name inside the `source_location` folder."
For example:
* The container named `portainer` has the mounted directory `/source/portainer`
For example:

* The container named `portainer` will be backed up with the mounted directory `/source/portainer`

* The container named `trilium` has the mounted directory `/source/trilium`
* The container named `trilium` will be backed up with the mounted directory `/source/trilium`

* The container named `trilium` will *not* workd with the mounted directory `/source/trilium-data`
* The container named `trilium` will be ==skipped== with the mounted directory `/source/trilium-data`

A container with *no* directory will just be skipped. For example:

* The container named `dozzle` has no mounted directory, so it wil be skipped.

<br>

## Example
This example can help explain how Nautical decides which containers to backup.

Assume the `src` directory is folder mounted in the container: `-v /src:/app/source`

<br>
| Conatianer Name | Data Directory | Action | Reasoning |
| --------------- | -------------------- | ------ | ----------------------------------------- |
| homeassistant | `/src/homeassistant` | Backup | |
| unifi | `/src/unifi` | Backup | |
| tautulli | `/src/plex-data` | Skip | Container name and data dir don't match |
| homepage | `/src/dashboard` | Skip | Container name and data dir don't match |
| dozzle | *No data directory* | Skip | No data directory matching container name |
| watchtower | *No data directory* | Skip | No data directory matching container name |
| traefik | `/src/traefik/data` | Backup | `traefik` and all subfolders |
| portainer | `/src/portainer` | Backup | |
| trilium | `/src/trilium` | Backup | |
4 changes: 2 additions & 2 deletions docs/q-and-a.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


#### Why do we need docker volume backups?
If your Docker Host machine doesn't take snapshots like a ZFS TrueNAS machine does. This means that even though we may have redundancy, it doesn't protect aginst fauly configuration or complete deletion of our container data.
If your Docker Host machine doesn't take snapshots like a ZFS TrueNAS machine does. This means that even though we may have redundancy, it doesn't protect aginst faulty configuration or complete deletion of our container data.

#### Why don't I store the container volumes directly on a NFS share?
This is common idea, but SQL databases would constantly go into a locked state about once every few weeks.
Expand All @@ -12,7 +12,7 @@ This is important for containers that run databases, especially SQL. During data

Stopping the container guarantees it was given the proper time to gracefully stop all services before we create a backup. Yes, there will be downtime for this, but it is only a few seconds and you can schedule this to run in off-peak hours.

#### Why don't we backup the container itself?
#### Why don't we backup the entire container itself?
Containers are meant to be ephemeral, and essentially meaniningless. The goal is to have only the data referenced by the container be important--not the container itself.

If something bad happened to our entier docker stack, we only need the `docker-compose` files and the data they referenced. This would allow us to be back online in no time!
Expand Down
9 changes: 9 additions & 0 deletions docs/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This project is not complete, and is still under active development. Below are a few examples of things we would like to add:

* [ ] Backup file exclusions
* For example, you could exclude `*.log` file from only the Trilium container.
* [ ] Custmizable container directories
* Currently, the container name must match the directory name; this would be nice to change.
* [ ] Lifecycle hooks
* Allow calling a script in the container that will about to be shutdown.

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ nav:
- Introduction: introduction.md
- Installation: installation.md
- Q & A: q-and-a.md
- To Do: todo.md


extra:
Expand Down

0 comments on commit ec34129

Please sign in to comment.