Skip to content

Commit

Permalink
Check backup file existence
Browse files Browse the repository at this point in the history
  • Loading branch information
afbora committed Feb 24, 2024
1 parent 901f459 commit 8a727cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8a727cf

Please sign in to comment.