Skip to content

Commit 77a380a

Browse files
author
buildplan
committed
allow file based backs
1 parent cc1df1c commit 77a380a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

restic-backup.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22

33
# =================================================================
4-
# Restic Backup Script v0.39 - 2025.10.25
4+
# Restic Backup Script v0.40 - 2025.11.18
55
# =================================================================
66

77
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
88
set -euo pipefail
99
umask 077
1010

1111
# --- Script Constants ---
12-
SCRIPT_VERSION="0.39"
12+
SCRIPT_VERSION="0.40"
1313
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
1414
PROG_NAME=$(basename "$0"); readonly PROG_NAME
1515
CONFIG_FILE="${SCRIPT_DIR}/restic-backup.conf"
@@ -876,8 +876,9 @@ run_preflight_checks() {
876876
fi
877877
for source in "${BACKUP_SOURCES[@]}"; do
878878
if [[ "$verbosity" == "verbose" ]]; then printf " %-65s" "Source directory ('$source')..."; fi
879-
if [ ! -d "$source" ] || [ ! -r "$source" ]; then
880-
handle_failure "Source directory not found or not readable: $source" "13"
879+
# Changed -d (directory) to -e (exists) to allow single file backups (v0.40)
880+
if [ ! -e "$source" ] || [ ! -r "$source" ]; then
881+
handle_failure "Source path not found or not readable: $source" "13"
881882
fi
882883
if [[ "$verbosity" == "verbose" ]]; then echo -e "[${C_GREEN} OK ${C_RESET}]"; fi
883884
done

restic-backup.sh.sha256

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6fa38405aef2bdeb4f6418630601ab1d91021c59ddbeea7fcfa219d39cc477c8 restic-backup.sh
1+
325a6e1ce4492d171827e122f02571e7006d9aefebf7488ef668d3cb63a34d81 restic-backup.sh

0 commit comments

Comments
 (0)