From 2bb5bb7b5b69d011cf5c771c4f514d2d9bfe7d25 Mon Sep 17 00:00:00 2001 From: Shikiryu Date: Wed, 8 Nov 2017 20:39:39 +0100 Subject: [PATCH] =?UTF-8?q?:lock:=20V=C3=A9rifie=20si=20le=20dossier=20exi?= =?UTF-8?q?ste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cron.php b/cron.php index 1e58329..e15d51a 100644 --- a/cron.php +++ b/cron.php @@ -80,7 +80,9 @@ if ($actions->connect()) { // Backup foreach ($deals_to_backup as $deal_to_backup) { - rename(EXISTING_DEALS_DIR.'/'.$deal_to_backup->getId(), BACKUP_DEALS_DIR.'/'.$deal_to_backup->getId()); + if (!file_exists(BACKUP_DEALS_DIR.'/'.$deal_to_backup->getId())) { + rename(EXISTING_DEALS_DIR . '/' . $deal_to_backup->getId(), BACKUP_DEALS_DIR . '/' . $deal_to_backup->getId()); + } } // Creation