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