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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -310,7 +310,7 @@ END_EXCLUDES

```bash
#!/bin/bash
# ===================== v0.33 - 2025.08.15 ========================
# ===================== v0.34 - 2025.08.15 ========================
#
# =================================================================
# SCRIPT INITIALIZATION & SETUP
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion backup.conf
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
8 changes: 4 additions & 4 deletions backup_script.sh
Original file line number Diff line number Diff line change
@@ -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/./"
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion backup_script.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0326b76d0b48e10bc03c4a3b03a7c647bad2579976d50e04f41a014291a747d6 backup_script.sh
6f2c36b78fae2803420ce49c4052372815af678983596369f6d81e7924175cb0 backup_script.sh
1 change: 0 additions & 1 deletion clean_backup.conf
Original file line number Diff line number Diff line change
@@ -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/"

Expand Down