@@ -184,7 +184,7 @@ To run the backup automatically, edit the root crontab.
184184
185185```ini
186186# =================================================================
187- # Configuration for rsync Backup Script v0.29
187+ # Configuration for rsync Backup Script v0.30
188188# =================================================================
189189# !! IMPORTANT !! Set file permissions to 600 (chmod 600 backup.conf)
190190
@@ -216,6 +216,9 @@ BEGIN_SSH_OPTS
216216/root/.ssh/id_ed25519
217217END_SSH_OPTS
218218
219+ # The timeout in seconds for rsync operations.
220+ RSYNC_TIMEOUT=300
221+
219222# --- Performance ---
220223# Optional: Limit rsync' s bandwidth usage in KiB/s. Leave empty or set to 0 to disable.
221224# Example: BANDWIDTH_LIMIT_KBPS=5000 (for 5 MB/s)
@@ -301,7 +304,7 @@ END_EXCLUDES
301304
302305` ` ` bash
303306#! /bin/bash
304- # ===================== v0.29 - 2025.08.13 ========================
307+ # ===================== v0.30 - 2025.08.13 ========================
305308#
306309# =================================================================
307310# SCRIPT INITIALIZATION & SETUP
@@ -372,7 +375,7 @@ if [ -f "$CONFIG_FILE" ]; then
372375
373376 case " $key " in
374377 BACKUP_DIRS|BOX_DIR|BOX_ADDR|LOG_FILE|LOG_RETENTION_DAYS|\
375- MAX_LOG_SIZE_MB|BANDWIDTH_LIMIT_KBPS|\
378+ MAX_LOG_SIZE_MB|BANDWIDTH_LIMIT_KBPS|RSYNC_TIMEOUT| \
376379 CHECKSUM_ENABLED|\
377380 NTFY_ENABLED|DISCORD_ENABLED|NTFY_TOKEN|NTFY_URL|DISCORD_WEBHOOK_URL|\
378381 NTFY_PRIORITY_SUCCESS|NTFY_PRIORITY_WARNING|NTFY_PRIORITY_FAILURE|\
@@ -432,7 +435,7 @@ if (( ${#SSH_OPTS_ARRAY[@]} > 0 )); then
432435fi
433436
434437RSYNC_BASE_OPTS=(
435- -aR -z --delete --partial --timeout=60 --mkpath
438+ -aR -z --delete --partial --timeout=" ${RSYNC_TIMEOUT :- 300} " --mkpath --noatime
436439 --exclude-from=" $EXCLUDE_FILE_TMP "
437440 -e " $SSH_CMD "
438441)
@@ -929,6 +932,10 @@ FINAL_MESSAGE=$(printf "%s\n\nSuccessful: %s\nFailed: %s\n\nDuration: %dm %ds" \
929932 " ${failed_dirs[*]:- None} " \
930933 $(( DURATION / 60 )) $(( DURATION % 60 )) )
931934
935+ if [[ ${# FINAL_MESSAGE} -gt 1800 ]]; then
936+ FINAL_MESSAGE=$( printf " %.1800s\n\n[Message truncated, see %s for full details]" " $FINAL_MESSAGE " " $LOG_FILE " )
937+ fi
938+
932939if [[ ${# failed_dirs[@]} -eq 0 ]]; then
933940 log_message " SUCCESS: All backups completed."
934941 if [[ $overall_exit_code -eq 24 ]]; then
0 commit comments