Fichiers de départ
This commit is contained in:
32
scripts/controle.php
Normal file
32
scripts/controle.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$global_flag = true;
|
||||
$backup = $argv[1];
|
||||
$signatures=$backup.'/signatures.sqlite';
|
||||
|
||||
if (!is_dir($backup)) die("$backup NOT FOUND !");
|
||||
if (!file_exists($signatures)) die("$signatures NOT FOUND !");
|
||||
|
||||
$connexion = new PDO('sqlite:'.$signatures);
|
||||
|
||||
$result = $connexion->query("SELECT sha1, filename, filesize FROM signatures");
|
||||
if ($result !== FALSE)
|
||||
foreach($result as $f)
|
||||
{
|
||||
$flag = FALSE;
|
||||
$fichier = $backup.'/'.$f['filename'];
|
||||
|
||||
if (file_exists($fichier)) $flag = TRUE;
|
||||
if (file_exists("$fichier.gz")) $flag = TRUE;
|
||||
|
||||
if (!$flag)
|
||||
{
|
||||
echo $fichier.' inexistant !'.PHP_EOL;
|
||||
$global_flag = FALSE;
|
||||
}
|
||||
}
|
||||
$connexion = null;
|
||||
|
||||
if ($global_flag) echo "Control signatures OK".PHP_EOL;
|
||||
else echo "Control signatures NOK".PHP_EOL;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user