Skip to content

Commit

Permalink
Update Backup.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber authored Oct 2, 2024
1 parent cff063b commit 5d42587
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions web/app/Models/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,26 @@ public static function boot()

public function checkCronJob()
{
$cronJobCommand = 'phyre-php /usr/local/phyre/web/artisan phyre:run-backup-checks';
$findCronJob = CronJob::where('command', $cronJobCommand)->first();
if (! $findCronJob) {
$cronJob = new CronJob();
$cronJob->schedule = '*/5 * * * *';
$cronJob->command = $cronJobCommand;
$cronJob->user = 'root';
$cronJob->save();
}

$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();
}

//$cronJobCommand = 'phyre-php /usr/local/phyre/web/artisan phyre:run-backup-checks';
//$findCronJob = CronJob::where('command', $cronJobCommand)->first();
//if (! $findCronJob) {
// $cronJob = new CronJob();
// $cronJob->schedule = '*/5 * * * *';
//$cronJob->command = $cronJobCommand;
//$cronJob->user = 'root';
//$cronJob->save();
//}

// $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 true;
}
Expand Down

0 comments on commit 5d42587

Please sign in to comment.