🚑 Vérifie la présence de backup
This commit is contained in:
parent
16af2429da
commit
852e9ba1c5
6
cron.php
6
cron.php
@ -51,8 +51,10 @@ if ($actions->connect()) {
|
||||
echo sprintf('elle est vieille (%s), on la supprime. %s', $existing_deals[$deal->getId()]->getDateCreation()->format('d/m/Y H:i'), "\n");
|
||||
$actions->delete($deal);
|
||||
// Backup
|
||||
mkdir(BACKUP_DEALS_DIR.'/'.$deal->getId());
|
||||
copy_folder(EXISTING_DEALS_DIR.'/'.$deal->getId(), BACKUP_DEALS_DIR.'/'.$deal->getId());
|
||||
if (!file_exists(BACKUP_DEALS_DIR.'/'.$deal->getId())) {
|
||||
mkdir(BACKUP_DEALS_DIR . '/' . $deal->getId());
|
||||
copy_folder(EXISTING_DEALS_DIR . '/' . $deal->getId(), BACKUP_DEALS_DIR . '/' . $deal->getId());
|
||||
}
|
||||
// Placement en "à créer"
|
||||
rename(EXISTING_DEALS_DIR.'/'.$deal->getId(), NEW_DEALS_DIR.'/'.$deal->getId());
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user