<- Back to Home
๐ฆ Paperless Backup
An automated Docker-based backup system for Paperless-ngx with email notifications and retention policies.
Features
- ๐ Automated Backups - Time-scheduled backups with cron integration
- ๐ง Email Notifications - Success and failure alerts via SMTP
- ๐งน Retention Policy - Automatic cleanup of old backups
Available on
๐ Quick Start
minimal Docker Run
docker run -d \
--name paperless-backup \
-e PAPERLESS_CONTAINER_NAME=paperless \
-e PAPERLESS_EXPORT_DIR=../export \
-v /path/to/paperless/export:/export \
-v /path/to/backups:/backups \
-v /var/run/docker.sock:/var/run/docker.sock \
ghcr.io/rossberi/paperless-backup:latestDocker Compose (with SMTP)
services:
paperless-backup:
image: ghcr.io/rossberi/paperless-backup:latest
container_name: paperless-backup
environment:
PAPERLESS_CONTAINER_NAME: paperless
PAPERLESS_EXPORT_DIR: '../export'
BACKUP_DIR: '/backups'
EXPORT_DIR: '/export'
BACKUP_PREFIX: 'backup'
BACKUP_SCHEDULE: '0 2 * * *' # Optional: Daily at 02:00
KEEP_BACKUPS: 7
BACKUP_ON_STARTUP: False
# Optional: SMTP Configuration
# SMTP_SERVER: smtp.example.com
# SMTP_PORT: 587
# SMTP_USERNAME: your-email@example.com
# SMTP_PASSWORD: your-app-password
# SMTP_SENDER: your-email@example.com
# SMTP_RECIPIENT: recipient@example.com
# SMTP_SUBJECT_SUCCESS: "โ
Paperless Backup successful"
# SMTP_SUBJECT_FAILURE: "โ Paperless Backup failed"
# SMTP_SECURITY: starttls
volumes:
- /path/to/paperless/export:/export
- /path/to/backups:/backups
- /var/run/docker.sock:/var/run/docker.sockโ๏ธ Configuration
Required Environment Variables
| Variable | Default | Description |
|---|---|---|
PAPERLESS_CONTAINER_NAME | paperless | Name of the Paperless Docker container |
PAPERLESS_EXPORT_DIR | ../export | Export directory inside Paperless container |
BACKUP_DIR | /backup | Target directory for backups |
BACKUP_PREFIX | backup | Prefix of the backup files |
EXPORT_DIR | /export | Local export directory |
KEEP_BACKUPS | 7 | Number of backup versions to keep |
BACKUP_ON_STARTUP | False | Run a backup on startup |
Optional: SMTP Configuration
To enable email notifications, set the following variables:
| Variable | Description |
|---|---|
SMTP_SERVER | SMTP server address |
SMTP_PORT | SMTP port (default: 587) |
SMTP_USERNAME | Username for SMTP authentication |
SMTP_PASSWORD | Password for SMTP authentication |
SMTP_SENDER | Sender email address |
SMTP_RECIPIENT | Recipient email address |
SMTP_SUBJECT_SUCCESS | Subject line for successful backup |
SMTP_SUBJECT_FAILURE | Subject line for failed backup |
SMTP_SECURITY | Security type: starttls (default), ssl, or plain |
Cron Syntax
The BACKUP_SCHEDULE variable uses standard cron syntax:
โญโโโโโโโโโโโโโโโโโโ Minute (0 - 59)
โ โญโโโโโโโโโโโโโโโโ Hour (0 - 23)
โ โ โญโโโโโโโโโโโโโโ Day of Month (1 - 31)
โ โ โ โญโโโโโโโโโโโโ Month (1 - 12)
โ โ โ โ โญโโโโโโโโโโ Day of Week (0 - 6) (Sunday = 0)
โ โ โ โ โ
โ โ โ โ โ
* * * * *Examples:
0 2 * * *- Daily at 02:00 AM0 3 * * 0- Every Sunday at 03:00 AM30 1 * * *- Daily at 01:30 AM0 */4 * * *- Every 4 hours
๐ License
This project is licensed under the MIT License.
๐ Support
๐ Resources
Note: Make sure to regularly test your backups and keep them in a safe location! ๐