Skip to content

A live bird collage card for your Home Assistant dashboard.

adding the new button

Patrick McGuiredbd5fd95bf76
diff --git a/scripts/backup_data.php b/scripts/backup_data.php
new file mode 100644
index 00000000..c6587be5
--- /dev/null
+++ b/scripts/backup_data.php
@@ -0,0 +1,4 @@
+<?php
+shell_exec("sudo -u pi /home/pi/BirdNET-Pi/scripts/backup_data.sh > /tmp/birdnetbackup.log 2&>1");
+header('Location: /backup_inprogress.html');
+?>
diff --git a/scripts/backup_data.sh b/scripts/backup_data.sh
new file mode 100755
index 00000000..2379fdef
--- /dev/null
+++ b/scripts/backup_data.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+# Tar and compress all data
+source /etc/birdnet/birdnet.conf
+
+tar -czvf /home/pi/BirdNET-Pi/BirdNET-Pi_Data_Dump_$(date +%F).tar.gz ${EXTRACTED} /home/pi/BirdNET-Pi/BirdDB.txt
diff --git a/scripts/backup_inprogress.html b/scripts/backup_inprogress.html
new file mode 100644
index 00000000..f6711634
--- /dev/null
+++ b/scripts/backup_inprogress.html
@@ -0,0 +1,12 @@
+<html lang="en">
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <head></head>
+ <body style="background-color: rgb(119, 196, 135);font-size:large;">
+
+ A backup is being made that includes all of<br>
+ your extractions and the BirdDB.txt<br>
+ <br></br>
+ The backup is in /home/pi/BirdNET-Pi
+ </body>
+</html>