diff --git a/config/wemx-backup.php b/config/wemx-backup.php index 1a507e5..dc605d5 100644 --- a/config/wemx-backup.php +++ b/config/wemx-backup.php @@ -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 ]; diff --git a/src/CommandsServiceProvider.php b/src/CommandsServiceProvider.php index 7d24d8d..959ca77 100644 --- a/src/CommandsServiceProvider.php +++ b/src/CommandsServiceProvider.php @@ -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; @@ -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')); - } + // }); + // } } /**