Skip to content

Add automated encrypted daily backup for paperless-ngx#95

Merged
michaelbarton merged 1 commit into
masterfrom
paperless-backup
Jun 10, 2026
Merged

Add automated encrypted daily backup for paperless-ngx#95
michaelbarton merged 1 commit into
masterfrom
paperless-backup

Conversation

@michaelbarton

Copy link
Copy Markdown
Owner

Summary

  • Adds paperless-ngx/backup.sh — pulls secrets from macOS Keychain, runs document_exporter inside the container, uploads to Backblaze B2 via restic (encrypted, deduplicated), prunes to 7 daily / 2 weekly / 2 monthly snapshots
  • Adds paperless-ngx/uk.me.michaelbarton.paperless-backup.plist — launchd agent firing daily at 03:00 (RunAtLoad false)
  • Adds volume mount ~/.paperless-backup-staging:/usr/src/paperless/backup to docker-compose.yml
  • Adds ansible/tasks/paperless_backup.yml — installs restic, staging dir, plist; tagged paperless-backup / never so it only runs on explicit request and won't affect other machines
  • Updates ansible/dotfiles.yml to include the new task

Test plan

  • Restic repo initialised on Backblaze B2 (restic init)
  • Full backup ran successfully end-to-end (418 documents, 320 MiB uploaded, snapshot 9bbec337 saved)
  • Prune ran cleanly after backup
  • Install launchd agent: ansible-playbook ansible/dotfiles.yml --tags paperless-backup
  • Verify agent loaded: launchctl list | grep paperless-backup

One-time setup (already done)

Secrets stored in macOS Keychain — see comments in ansible/tasks/paperless_backup.yml for the security add-generic-password commands and restic init steps.

🤖 Generated with Claude Code

Uses paperless document_exporter for version-independent exports, restic for
encrypted/deduplicated snapshots, and launchd for daily 03:00 scheduling.
Secrets stored in macOS Keychain at runtime — no plaintext credentials on disk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@michaelbarton michaelbarton merged commit 93f39a9 into master Jun 10, 2026
2 checks passed
@michaelbarton michaelbarton deleted the paperless-backup branch June 10, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant