Initial commit
This commit is contained in:
22
src-backup/qr/simple_cleanup.php
Normal file
22
src-backup/qr/simple_cleanup.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// simple_cleanup.php
|
||||
$temp_dir = '../temp_qrcodes/';
|
||||
|
||||
if (file_exists($temp_dir)) {
|
||||
$files = glob($temp_dir . '*.png');
|
||||
$deleted = 0;
|
||||
|
||||
foreach ($files as $file) {
|
||||
// Delete files older than 1 hour
|
||||
if (time() - filemtime($file) > 3600) {
|
||||
if (unlink($file)) {
|
||||
$deleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "Deleted $deleted old QR code files.";
|
||||
} else {
|
||||
echo "QR directory not found.";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user