1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-11 16:06:20 +01:00
openstamanager/modules/backups/src/BackupTask.php

25 lines
488 B
PHP
Raw Normal View History

2020-08-12 16:03:25 +02:00
<?php
namespace Modules\Backups;
use Backup;
use Tasks\Manager;
/**
* Task dedicato alla gestione del backup giornaliero automatico, se abilitato da Impostazioni.
*/
class BackupTask extends Manager
{
public function needsExecution()
{
return setting('Backup automatico') && !Backup::isDailyComplete();
}
public function execute()
{
if (setting('Backup automatico') && !Backup::isDailyComplete()) {
Backup::daily();
}
}
}