diff --git a/front/maintenance.php b/front/maintenance.php
index de350f84..cad959fc 100644
--- a/front/maintenance.php
+++ b/front/maintenance.php
@@ -21,6 +21,7 @@
@@ -53,7 +68,8 @@
diff --git a/front/php/server/devices.php b/front/php/server/devices.php
index 08a7f8f7..33582593 100644
--- a/front/php/server/devices.php
+++ b/front/php/server/devices.php
@@ -32,6 +32,9 @@
case 'setDeviceData': setDeviceData(); break;
case 'deleteDevice': deleteDevice(); break;
case 'deleteAllWithEmptyMACs': deleteAllWithEmptyMACs(); break;
+ case 'createBackupDB': createBackupDB(); break;
+ case 'restoreBackupDB': restoreBackupDB(); break;
+
case 'getDevicesTotals': getDevicesTotals(); break;
@@ -195,6 +198,37 @@ function deleteAllWithEmptyMACs() {
}
+//------------------------------------------------------------------------------
+// Create a DB backup
+//------------------------------------------------------------------------------
+function createBackupDB() {
+
+ //
+ $result = copy("/home/pi/pialert/db/pialert.db","/home/pi/pialert/config/pialert.db_bak");
+ // check result
+ if ($result == TRUE) {
+ echo "Copied successfully";
+ } else {
+ echo "Error copying DB. SSH into instance and copy manually.";
+ }
+}
+
+//------------------------------------------------------------------------------
+// Restore latest DB backup
+//------------------------------------------------------------------------------
+function restoreBackupDB() {
+
+ //
+ $result = copy("/home/pi/pialert/config/pialert.db_bak", "/home/pi/pialert/db/pialert.db");
+ // check result
+ if ($result == TRUE) {
+ echo "Copied successfully";
+ } else {
+ echo "Error copying DB. SSH into instance and copy manually.";
+ }
+}
+
+
//------------------------------------------------------------------------------
// Query total numbers of Devices by status
diff --git a/front/php/templates/header.php b/front/php/templates/header.php
index eae9305a..22204f33 100644
--- a/front/php/templates/header.php
+++ b/front/php/templates/header.php
@@ -170,7 +170,7 @@
- Maintenance
+ Maintenance