Browse Source

🚑 Vérifie la présence de backup

master
Shikiryu 4 years ago
parent
commit
852e9ba1c5
  1. 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…
Cancel
Save