mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
maintenance task DB
This commit is contained in:
@@ -219,76 +219,6 @@ function deleteAllDevices() {
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Run scan 1 min now
|
||||
//------------------------------------------------------------------------------
|
||||
function runScan1min() {
|
||||
|
||||
$command = escapeshellcmd('/home/pi/pialert/back/pialert.py 1');
|
||||
$output = shell_exec($command);
|
||||
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Run scan 15 min now
|
||||
//------------------------------------------------------------------------------
|
||||
function runScan15min() {
|
||||
|
||||
$command = escapeshellcmd('/home/pi/pialert/back/pialert.py 15');
|
||||
$output = shell_exec($command);
|
||||
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 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.";
|
||||
// }
|
||||
|
||||
$mystring = system('python /home/pi/pialert/back/maintenance.py backup_db', $retval);
|
||||
// $command = escapeshellcmd('/home/pi/pialert/back/maintenance.py backup_DB');
|
||||
// $output = shell_exec($command);
|
||||
|
||||
|
||||
//echo $output;
|
||||
echo $retval;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 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.";
|
||||
// }
|
||||
|
||||
$command = escapeshellcmd('/home/pi/pialert/back/maintenance.py restore_db');
|
||||
$output = shell_exec($command);
|
||||
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user