Prevent disk_check from erasing our "Best Recordings"

let me know what you think

@mcguirepr89
This commit is contained in:
ehpersonal38
2022-05-09 10:35:34 -04:00
parent aa4908559c
commit d469b1a759
2 changed files with 26 additions and 4 deletions
+10 -2
View File
@@ -52,6 +52,11 @@ if(isset($_GET['species'])){
}
$result3 = $statement3->execute();
}
$user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd");
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
$home = trim($home);
file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "");
?>
<html lang="en">
@@ -157,6 +162,10 @@ while($results=$result->fetchArray(SQLITE3_ASSOC))
$comname = preg_replace('/ /', '_', $results['Com_Name']);
$comname = preg_replace('/\'/', '', $comname);
$filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];
$excludefile = fopen($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "a") or die("Unable to open file!");
$txt = $results['Date']."/".$comname."/".$results['File_Name']."\n".$results['Date']."/".$comname."/".$results['File_Name'].".png\n";
fwrite($excludefile, $txt);
?>
<tr>
<form action="" method="GET">
@@ -174,5 +183,4 @@ $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];
</div>
</div>
</body>
</html>
</html>