Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
GIGABAIT93 committed Jan 31, 2023
1 parent 384961f commit f43fc4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/wemx-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

return [
'backup_directory' => '', // /home/backup/panel
'autobackup' => false, // true/false
'autobackup_interval' => 24, // hours
'autobackup' => true, // true/false
'autobackup_cron' => '*/5 * * * *', // hours
];
12 changes: 6 additions & 6 deletions src/CommandsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wemx\Installer;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\ServiceProvider;
use Wemx\Installer\Commands\BackupCommand;
use Wemx\Installer\Commands\CreateMySQLUser;
Expand Down Expand Up @@ -31,12 +30,13 @@ public function boot()

$this->publishes([__DIR__ . '/../config/wemx-backup.php' => config_path('wemx-backup.php')], 'wemx-backup');

if (config('wemx-backup.autobackup')) {
$this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
$schedule->command('backup --action=create --type=all')->cron(config('wemx-backup.autobackup_cron'));
});
// if (config('wemx-backup.autobackup')) {
// $this->app->booted(function () {
// $schedule = app(Schedule::class);
// $schedule->command('backup --action=create --type=all')->cron(config('wemx-backup.autobackup_cron'));

}
// });
// }
}

/**
Expand Down

0 comments on commit f43fc4d

Please sign in to comment.