From 8a727cfecf9545aa7ce54e932868db35470e82d7 Mon Sep 17 00:00:00 2001 From: Ahmet Bora Date: Sat, 24 Feb 2024 14:03:30 +0300 Subject: [PATCH] Check backup file existence --- commands/backup.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/backup.php b/commands/backup.php index 5f6b2eb..6f38492 100644 --- a/commands/backup.php +++ b/commands/backup.php @@ -32,6 +32,10 @@ $backupPath = $kirbyPath . '/backup'; $backupFile = $backupPath . '/' . $root . '-' . date('Y-m-d-His') . '.zip'; + if (is_file($backupFile) === true) { + throw new Exception('The backup file exists'); + } + // create backup directory before the process mkdir($backupPath);