Răsfoiți Sursa

cd into script directory

subDesTagesMitExtraKaese 2 luni în urmă
părinte
comite
076e38b196
1 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 8 1
      run_backup_process.sh

+ 8 - 1
run_backup_process.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+cd "$(dirname "$0")"
+
 # Load environment variables from .env file
 source .env
 
@@ -18,6 +20,7 @@ cleanup() {
     echo "Cleaning up..."
     echo "Unmounting HDD..."
     ./unmount_hdd.sh -f || echo "Failed to unmount HDD"
+    sleep 10
     echo "Turning off HDD power..."
     ./power_off_hdd.sh || echo "Failed to power off HDD"
 }
@@ -47,7 +50,7 @@ echo "Running backup..."
 
 # Log stats to influxdb
 echo "Logging backup to influxdb..."
-./log_to_influxdb.sh || handle_error "log_to_influxdb.sh"
+./log_to_influx.sh || handle_error "log_to_influx.sh"
 
 # Delay before unmounting
 echo "Waiting before unmounting HDD..."
@@ -57,6 +60,10 @@ sleep 5
 echo "Unmounting HDD..."
 ./unmount_hdd.sh || handle_error "unmount_hdd.sh"
 
+# Delay before turning off
+echo "Waiting before turning off HDD power..."
+sleep 10
+
 # Power off HDD
 echo "Turning off HDD power..."
 ./power_off_hdd.sh || handle_error "power_off_hdd.sh"