From b0af92273c95cc2334ed53d7b2a93d749998b19f Mon Sep 17 00:00:00 2001 From: buildplan Date: Fri, 15 Aug 2025 09:37:20 +0100 Subject: [PATCH 1/5] minor correction --- backup_script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backup_script.sh b/backup_script.sh index 5fd7c2f..c4ba2d4 100644 --- a/backup_script.sh +++ b/backup_script.sh @@ -1,5 +1,5 @@ #!/bin/bash -# ===================== v0.33 - 2025.08.15 ======================== +# ===================== v0.34 - 2025.08.15 ======================== # # Example backup.conf: # BACKUP_DIRS="/home/user/test/./ /var/www/./" @@ -223,7 +223,8 @@ run_integrity_check() { local DIRS_ARRAY; read -ra DIRS_ARRAY <<< "$BACKUP_DIRS" for dir in "${DIRS_ARRAY[@]}"; do echo "--- Integrity Check: $dir ---" >&2 - LC_ALL=C rsync "${rsync_check_opts[@]}" "$dir" "$REMOTE_TARGET" 2>> "${LOG_FILE:-/dev/null}" + local relative_path="${dir#*./}" + LC_ALL=C rsync "${rsync_check_opts[@]}" "$dir" "${REMOTE_TARGET}${relative_path}" 2>> "${LOG_FILE:-/dev/null}" done } parse_stat() { @@ -696,8 +697,7 @@ for dir in "${DIRS_ARRAY[@]}"; do RSYNC_EXIT_CODE=${PIPESTATUS[0]} else RSYNC_OPTS+=(--info=stats2) - nice -n 19 ionice -c 3 rsync "${RSYNC_OPTS[@]}" "$dir" "$REMOTE_TARGET" > "$RSYNC_LOG_TMP" 2>&1 - RSYNC_EXIT_CODE=$? + nice -n 19 ionice -c 3 rsync "${RSYNC_OPTS[@]}" "$dir" "$REMOTE_TARGET" > "$RSYNC_LOG_TMP" 2>&1 || RSYNC_EXIT_CODE=$? fi cat "$RSYNC_LOG_TMP" >> "$LOG_FILE"; full_rsync_output+=$'\n'"$(<"$RSYNC_LOG_TMP")" rm -f "$RSYNC_LOG_TMP" From 401072ffa6284dbe3f7a65b9046381488d8138c2 Mon Sep 17 00:00:00 2001 From: buildplan Date: Fri, 15 Aug 2025 09:37:54 +0100 Subject: [PATCH 2/5] version bump --- backup.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.conf b/backup.conf index 0b95fc0..8284ff0 100644 --- a/backup.conf +++ b/backup.conf @@ -1,5 +1,5 @@ # ================================================================= -# Configuration for rsync Backup Script v0.33 +# Configuration for rsync Backup Script v0.34 # ================================================================= # !! IMPORTANT !! Set file permissions to 600 (chmod 600 backup.conf) From d680ed5c5fe66426a1108b30f27c2dc0ecc99d97 Mon Sep 17 00:00:00 2001 From: buildplan <170122315+buildplan@users.noreply.github.com> Date: Fri, 15 Aug 2025 09:43:21 +0100 Subject: [PATCH 3/5] Update clean_backup.conf --- clean_backup.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/clean_backup.conf b/clean_backup.conf index 0a458bb..5907046 100644 --- a/clean_backup.conf +++ b/clean_backup.conf @@ -1,5 +1,4 @@ # --- Source and Destination --- -# List all source directories to back up, separated by spaces. BACKUP_DIRS="/./home/user/ /./var/log/ /./etc/nginx/" BOX_DIR="/home/myvps/" From c3851bd427411210964d6006f922c641708905e6 Mon Sep 17 00:00:00 2001 From: buildplan <170122315+buildplan@users.noreply.github.com> Date: Fri, 15 Aug 2025 09:44:42 +0100 Subject: [PATCH 4/5] Update to match v0.34 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c78741f..2a4fd8c 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ To run the backup automatically, edit the root crontab. ```ini # ================================================================= -# Configuration for rsync Backup Script v0.33 +# Configuration for rsync Backup Script v0.34 # ================================================================= # !! IMPORTANT !! Set file permissions to 600 (chmod 600 backup.conf) @@ -310,7 +310,7 @@ END_EXCLUDES ```bash #!/bin/bash -# ===================== v0.33 - 2025.08.15 ======================== +# ===================== v0.34 - 2025.08.15 ======================== # # ================================================================= # SCRIPT INITIALIZATION & SETUP @@ -503,7 +503,8 @@ run_integrity_check() { local DIRS_ARRAY; read -ra DIRS_ARRAY <<< "$BACKUP_DIRS" for dir in "${DIRS_ARRAY[@]}"; do echo "--- Integrity Check: $dir ---" >&2 - LC_ALL=C rsync "${rsync_check_opts[@]}" "$dir" "$REMOTE_TARGET" 2>> "${LOG_FILE:-/dev/null}" + local relative_path="${dir#*./}" + LC_ALL=C rsync "${rsync_check_opts[@]}" "$dir" "${REMOTE_TARGET}${relative_path}" 2>> "${LOG_FILE:-/dev/null}" done } parse_stat() { @@ -976,8 +977,7 @@ for dir in "${DIRS_ARRAY[@]}"; do RSYNC_EXIT_CODE=${PIPESTATUS[0]} else RSYNC_OPTS+=(--info=stats2) - nice -n 19 ionice -c 3 rsync "${RSYNC_OPTS[@]}" "$dir" "$REMOTE_TARGET" > "$RSYNC_LOG_TMP" 2>&1 - RSYNC_EXIT_CODE=$? + nice -n 19 ionice -c 3 rsync "${RSYNC_OPTS[@]}" "$dir" "$REMOTE_TARGET" > "$RSYNC_LOG_TMP" 2>&1 || RSYNC_EXIT_CODE=$? fi cat "$RSYNC_LOG_TMP" >> "$LOG_FILE"; full_rsync_output+=$'\n'"$(<"$RSYNC_LOG_TMP")" rm -f "$RSYNC_LOG_TMP" From a88e3af0cb5e4595c89348ab47bb68b727bd25e0 Mon Sep 17 00:00:00 2001 From: buildplan Date: Fri, 15 Aug 2025 09:46:25 +0100 Subject: [PATCH 5/5] sha256 for v0.34 --- backup_script.sh.sha256 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup_script.sh.sha256 b/backup_script.sh.sha256 index fb2c061..e7b8c10 100644 --- a/backup_script.sh.sha256 +++ b/backup_script.sh.sha256 @@ -1 +1 @@ -0326b76d0b48e10bc03c4a3b03a7c647bad2579976d50e04f41a014291a747d6 backup_script.sh +6f2c36b78fae2803420ce49c4052372815af678983596369f6d81e7924175cb0 backup_script.sh