Paperless-NGX backup script
- Modify the
BACKUP_DIRvariable to match your actual backup directory. If you are having trouble with script try setting backup directory to ../export and make sure your docker compose has a drive setup for export. - Save the script as
paperless_backup.sh. - Give execution permission:
chmod +x backup_paperless.sh
- Run manually for testing:
./backup_paperless.sh
- Open the crontab editor:
crontab -e
- Add this line at the end to run the script daily at 2 AM:
0 2 * * * /path/to/backup_paperless.sh >> /var/log/backup_paperless.log 2>&1
- Creates a new backup daily.
- Retains only the last 7 backups.
- Deletes older backups automatically.