Change backup directory to /opt for paperless-ngx (#9195)

* Change backup directory to /opt for paperless-ngx

Using /tmp for the backup is risky since many installations host it with tmpfs and thereby in RAM.

Having a bigger document base will deplete the memory on backup.

* Update paperless-ngx.sh

Added missing change.
This commit is contained in:
ProfDrYoMan
2025-11-16 18:55:46 +01:00
committed by GitHub
parent 1405e28247
commit ca2903b1ff

View File

@@ -35,7 +35,7 @@ function update_script() {
if grep -q "uv run" /etc/systemd/system/paperless-webserver.service; then
msg_info "Backing up user data and configuration"
local BACKUP_DIR="/tmp/paperless_backup_$$"
local BACKUP_DIR="/opt/paperless_backup_$$"
mkdir -p "$BACKUP_DIR"
for dir in /opt/paperless/*/; do
dir_name=$(basename "$dir")
@@ -84,7 +84,7 @@ function update_script() {
find /opt/paperless -name "__pycache__" -type d -exec rm -rf {} +
msg_info "Backing up user data and configuration"
local BACKUP_DIR="/tmp/paperless_backup_$$"
local BACKUP_DIR="/opt/paperless_backup_$$"
mkdir -p "$BACKUP_DIR"
for dir in /opt/paperless/*/; do
@@ -122,7 +122,7 @@ function update_script() {
$STD systemctl daemon-reload
msg_info "Backing up user data and configuration"
BACKUP_DIR="/tmp/paperless_backup_$$"
BACKUP_DIR="/opt/paperless_backup_$$"
mkdir -p "$BACKUP_DIR"
for dir in /opt/paperless/*/; do