|
@@ -46,11 +46,19 @@ echo "Mounting HDD..."
|
|
|
|
|
|
# Run backup
|
|
|
echo "Running backup..."
|
|
|
-./run_backup.sh || handle_error "run_backup.sh"
|
|
|
+./borg_create.sh || handle_error "borg_create.sh"
|
|
|
|
|
|
# Log stats to influxdb
|
|
|
echo "Logging backup to influxdb..."
|
|
|
-./log_to_influx.sh || handle_error "log_to_influx.sh"
|
|
|
+./log_to_influx.sh || echo "Error occurred in script: log_to_influx.sh"
|
|
|
+
|
|
|
+# Log stats to influxdb
|
|
|
+echo "Pruning old backups..."
|
|
|
+./borg_prune.sh || echo "Error occurred in script: borg_prune.sh"
|
|
|
+
|
|
|
+# Log stats to influxdb
|
|
|
+echo "Compacting archives..."
|
|
|
+./borg_compact.sh || echo "Error occurred in script: borg_compact.sh"
|
|
|
|
|
|
# Delay before unmounting
|
|
|
echo "Waiting before unmounting HDD..."
|
|
@@ -69,3 +77,5 @@ echo "Turning off HDD power..."
|
|
|
./power_off_hdd.sh || handle_error "power_off_hdd.sh"
|
|
|
|
|
|
echo "Backup process completed successfully."
|
|
|
+trap - EXIT
|
|
|
+exit 0
|