Enhance game saves backup function with verbose logging and improved error reporting

This commit is contained in:
Max Engel
2025-07-24 19:28:24 -04:00
parent 5b33eaf4a0
commit cbc1bcb980

View File

@@ -388,7 +388,7 @@ backup_game_saves() {
fi
done
fi
# Build the complete options array
local all_opts=()
if [ ${#filtered_opts[@]} -gt 0 ]; then
@@ -398,35 +398,35 @@ backup_game_saves() {
"--progress"
"--log-file" "/var/log/cloud_sync.log"
"--filter-from" "/storage/.config/cloud_sync-rules.txt"
"--delete-excluded"
)
fi
# Add debug logging if enabled
if [ -n "$rclone_debug" ]; then
all_opts+=("$rclone_debug")
fi
# Add exclusions
all_opts+=(
"--exclude=${BACKUPFOLDER}/**"
"--exclude=backups/**"
"--exclude=bios/**"
"--exclude=*.zip"
"--verbose"
)
# Execute rclone with enhanced error handling
execute_rclone_with_error_handling \
"${BACKUPMETHOD}" \
"${BACKUPPATH}/" \
"${REMOTENAME}${SYNCPATH}/" \
"${all_opts[@]}"
BACKUP_STATUS=$?
# Report the result with detailed error information
report_rclone_error $BACKUP_STATUS "Game saves backup"
return $BACKUP_STATUS
}
@@ -553,4 +553,4 @@ main() {
trap 'log_message "Script interrupted by user" "false" "WARN"; clean_exit 130' INT TERM
# Start script execution
main
main