From 5f5815cbd950b9c555a7911515145f41977ac00a Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 17 Mar 2024 20:49:15 +0100 Subject: [PATCH] clean auto backup --- core/module/config/tool/cleanautobackup.php | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 core/module/config/tool/cleanautobackup.php diff --git a/core/module/config/tool/cleanautobackup.php b/core/module/config/tool/cleanautobackup.php new file mode 100644 index 00000000..732ac562 --- /dev/null +++ b/core/module/config/tool/cleanautobackup.php @@ -0,0 +1,22 @@ +isFile() && $file->getExtension() === 'tar.gz') { + // Vérifie si le fichier a été modifié avant la limite de temps + if ($file->getMTime() < $timeLimit) { + // Supprime le fichier + unlink($file->getRealPath()); + } + } +} +?>