johannmx / paperless-ngx_backup

Backs up Paperless-ngx files and directories automatically (docker container) with notifications (AppRise intregration)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

💾 Paperless-ngx Backup + notifications (AppRise integration)

Backs up Paperless-ngx files and directories to tar.xz archives automatically. tar.xz archives can be opened using data compression programs like 7-Zip and WinRAR.

#####Docker image for all platforms, like ARM (Raspberry Pi) GitHub

Files and directories that are backed up:

  • /pgdata
  • /data
  • /media

Usage

Automatic Backups

Refer to the docker-compose section below. By default, backing up is automatic.

Manual Backups

Pass manual to docker run or docker-compose as a command.

docker-compose

---
version: "2.1"
services:
  backup:
    image: ghcr.io/johannmx/paperless-ngx_backup:main
    container_name: paperless-ngx_backup
    volumes:
      - /docker/paperless/data:/data:ro # Read-only
      - /backups/paperless/:/backups
      #- /etc/localtime:/etc/localtime:ro # Container uses date from host.
    environment:
      - DELETE_AFTER=30
      #- CRON_TIME=*/5 * * * * # At every 5th minute.
      - CRON_TIME=0 3 * * * # Runs at 3am.
      - UID=1000
      - GID=100
      - TZ=America/Argentina/Buenos_Aires # Specify a timezone to use EG Europe/London.
      - WATCHTOWER_LABEL_ENABLE=false
      - GOTIFY_TOKEN=supertoken
      - GOTIFY_SERVER=subdomain.domain.com
      - SLACK_WEBHOOK=slakwebhook
      - DISCORD_WEBHOOK_ID=discordwebhookid
      - DISCORD_WEBHOOK_TOKEN=discordwebhooktoken

Volumes (permissions required)

/data (read)- Paperless-ngx's /data directory. Recommend setting mount as read-only.

/backups (write) - Where to store backups to.

Environment Variables

⭐Required, 👍 Recommended

Environment Variable Info
UID ⭐ User ID to run the cron job as.
GID ⭐ Group ID to run the cron job as.
CRON_TIME 👍 When to run (default is every 12 hours). Info [here][cron-format-wiki] and editor [here][cron-editor].
DELETE_AFTER 👍 (exclusive to automatic mode) Delete backups X days old. Requires read and write permissions.
GOTIFY_TOKEN 👍 Gotify Token generated for app.
GOTIFY_SERVER 👍 Endpoint server (subdomain.domain.com) without http/https.

Optional

Environment Variable Info
TZ ¹ Timezone inside the container. Can mount /etc/localtime instead as well (recommended).

¹ See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for more information

☑️ build docker --platforms

docker buildx create --name mybuilder --use
docker buildx build -t test/paperless-ngx_backup:latest --platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 --push .

Errors

Unexpected timestamp

Mount /etc/localtime (recommend mounting as read-only) or set TZ environment variable.

Info

[cron-format-wiki] https://www.ibm.com/docs/en/db2oc?topic=task-unix-cron-format
[cron-editor]: https://crontab.guru/
[Docker Build Arch]: https://andrewlock.net/creating-multi-arch-docker-images-for-arm64-from-windows/

About

Backs up Paperless-ngx files and directories automatically (docker container) with notifications (AppRise intregration)


Languages

Language:Shell 78.8%Language:Dockerfile 21.2%