Quellcode durchsuchen

don't retry to unmount

subDesTagesMitExtraKaese vor 3 Monaten
Ursprung
Commit
fe6b9fbd00
1 geänderte Dateien mit 1 neuen und 18 gelöschten Zeilen
  1. 1 18
      run_backup_process.sh

+ 1 - 18
run_backup_process.sh

@@ -20,23 +20,6 @@ cleanup() {
     ./power_off_hdd.sh || echo "Failed to power off HDD"
 }
 
-# Function to retry unmounting
-retry_umount() {
-    local max_retries=5
-    local count=0
-    while [ $count -lt $max_retries ]; do
-        if ./unmount_hdd.sh; then
-            echo "Successfully unmounted HDD."
-            return 0
-        else
-            echo "Unmount failed. Retrying ($((count + 1))/$max_retries)..."
-            sleep 15
-            count=$((count + 1))
-        fi
-    done
-    return 1
-}
-
 # Set trap to call cleanup on script exit or error
 trap 'cleanup' EXIT
 
@@ -66,7 +49,7 @@ sleep 5
 
 # Unmount HDD
 echo "Unmounting HDD..."
-retry_umount || handle_error "unmount_hdd.sh"
+./unmount_hdd.sh || handle_error "unmount_hdd.sh"
 
 # Power off HDD
 echo "Turning off HDD power..."