Paperless cloud backups
https://samsm.ch/paperless-cloud-backups/
Some documentation on how I setup backing up my paperless-ngx documents to dropbox using rclone and some custom code
Paperless cloud backups
https://samsm.ch/paperless-cloud-backups/
Some documentation on how I setup backing up my paperless-ngx documents to dropbox using rclone and some custom code
I actually use the
document_exporterofpaperless-ngx. I have a small bash scriptbackup-paperless.shthat runs the paperless-ngxdocument_exporterand also makes a database dump usingpg_dump. It sets up the restic backups logic with daily, weekly and monthly backups. I run that bash script using a systemd servicepaperless-backup.service. This service is run daily with the timerpaperless-backup.timer, randomly at 3 am ±30 minutes.resticis smart, so it does only backup if there are changes. The incremental backups are great, in case the database corrupts without me noticing. I’ll share the scripts in case you are interested in how it works:backup-paperless.sh
#!/bin/bash set -euo pipefail COMPOSE_DIR="/home/user/paperless-ngx/" DUMP_DIR="$COMPOSE_DIR/sqldump" EXPORT_DIR="/usr/src/paperless/export" export RESTIC_REPOSITORY="sftp:abc123@abc123.your-storagebox.de:/backup/restic" export RESTIC_PASSWORD_FILE="/home/user/.config/restic/password" mkdir -p "$DUMP_DIR" cd "$COMPOSE_DIR" docker compose exec -T webserver document_exporter "$EXPORT_DIR" -p docker compose exec -T db pg_dump -U paperless paperless > "$DUMP_DIR/dump.sql" restic backup "$DUMP_DIR" "$COMPOSE_DIR/export" restic forget \ --keep-daily 7 \ --keep-weekly 4 \ --keep-monthly 6 \ --prune rm -rf "$COMPOSE_DIR/export"/* rm -rf "$DUMP_DIR"/*paperless-backup.service
[Unit] Description=Paperless-ngx Restic Backup Wants=network-online.target After=network-online.target docker.service [Service] Type=oneshot User=user WorkingDirectory=/home/user/paperless-ngx ExecStart=/home/user/paperless-ngx/backup-paperless.shpaperless-backup.timer
[Unit] Description=Run paperless backup every 24 hours [Timer] OnCalendar=*-*-* 03:00:00 Persistent=true RandomizedDelaySec=30min [Install] WantedBy=timers.target