Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions restic-backup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 6 additions & 2 deletions restic-backup.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion restic-backup.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25b2f26099b3fce37ab0040c24d647dbc46b77d1411bd9cfec2bdd2d19cc971d restic-backup.sh
f46058f5e1dfb2cc158e30183d01d62a225b71459b4b702a9ec57113cb76f743 restic-backup.sh