From 50d7b9eee6d96a05a44e50c301457830fe9b07ed Mon Sep 17 00:00:00 2001 From: buildplan Date: Fri, 26 Sep 2025 21:54:03 +0100 Subject: [PATCH 1/2] Add optional custom cache directory setting --- restic-backup.conf | 3 +++ restic-backup.sh | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/restic-backup.conf b/restic-backup.conf index 13f9d40..f220ef1 100644 --- a/restic-backup.conf +++ b/restic-backup.conf @@ -10,6 +10,9 @@ RESTIC_REPOSITORY="sftp:storagebox:/home/vps" # Password file for repository encryption (create with: echo 'your-password' > /root/.restic-password) RESTIC_PASSWORD_FILE="/root/.restic-password" +# Optional cache directory to prevent ~/.cache/restic growth +RESTIC_CACHE_DIR="/var/cache/restic-backup" + # --- Source Directories --- # Use Bash array syntax for paths, especially if they contain spaces. # Each full path should be a separate, quoted element inside the parentheses. diff --git a/restic-backup.sh b/restic-backup.sh index 0097fca..0ad85bb 100644 --- a/restic-backup.sh +++ b/restic-backup.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash # ================================================================= -# Restic Backup Script v0.29 - 2025.09.21 +# Restic Backup Script v0.30 - 2025.09.26 # ================================================================= set -euo pipefail umask 077 # --- Script Constants --- -SCRIPT_VERSION="0.29" +SCRIPT_VERSION="0.30" SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) CONFIG_FILE="${SCRIPT_DIR}/restic-backup.conf" LOCK_FILE="/tmp/restic-backup.lock" @@ -457,6 +457,10 @@ send_notification() { setup_environment() { export RESTIC_REPOSITORY export RESTIC_PASSWORD_FILE + if [ -n "${RESTIC_CACHE_DIR:-}" ]; then + export RESTIC_CACHE_DIR + mkdir -p "$RESTIC_CACHE_DIR" + fi if [ -n "${EXCLUDE_PATTERNS:-}" ]; then EXCLUDE_TEMP_FILE=$(mktemp) echo "$EXCLUDE_PATTERNS" | tr ' ' '\n' > "$EXCLUDE_TEMP_FILE" From f6d99fee1eec47664d95dfadf4ebaaa1426dc1b3 Mon Sep 17 00:00:00 2001 From: buildplan Date: Sat, 27 Sep 2025 10:17:32 +0100 Subject: [PATCH 2/2] sha256 for v0.30 --- restic-backup.sh.sha256 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restic-backup.sh.sha256 b/restic-backup.sh.sha256 index 0592d1c..f73db47 100644 --- a/restic-backup.sh.sha256 +++ b/restic-backup.sh.sha256 @@ -1 +1 @@ -25b2f26099b3fce37ab0040c24d647dbc46b77d1411bd9cfec2bdd2d19cc971d restic-backup.sh +f46058f5e1dfb2cc158e30183d01d62a225b71459b4b702a9ec57113cb76f743 restic-backup.sh