|
@@ -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"
|