mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
update
This commit is contained in:
parent
72e7229539
commit
6ed95760b5
2 changed files with 14 additions and 2 deletions
|
@ -16,7 +16,7 @@ class RunBackup extends Command
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'phyre:run-backup';
|
||||
protected $signature = 'phyre:run-backup-checks';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
|
|
@ -54,7 +54,7 @@ class Backup extends Model
|
|||
|
||||
public function checkCronJob()
|
||||
{
|
||||
$cronJobCommand = 'phyre-php /usr/local/phyre/web/artisan phyre:run-backup';
|
||||
$cronJobCommand = 'phyre-php /usr/local/phyre/web/artisan phyre:run-backup-checks';
|
||||
$findCronJob = CronJob::where('command', $cronJobCommand)->first();
|
||||
if (! $findCronJob) {
|
||||
$cronJob = new CronJob();
|
||||
|
@ -64,6 +64,18 @@ class Backup extends Model
|
|||
$cronJob->save();
|
||||
return false;
|
||||
}
|
||||
|
||||
$cronJobCommand = 'phyre-php /usr/local/phyre/web/artisan phyre:create-daily-full-backup';
|
||||
$findCronJob = CronJob::where('command', $cronJobCommand)->first();
|
||||
if (! $findCronJob) {
|
||||
$cronJob = new CronJob();
|
||||
$cronJob->schedule = '0 0 * * *';
|
||||
$cronJob->command = $cronJobCommand;
|
||||
$cronJob->user = 'root';
|
||||
$cronJob->save();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue