argument('containers'); $this->line("### Backup is starting... ###"); $this->call("backup:container", [ 'containers' => $containers]); if ($this->option('data')) { $this->call("backup:data"); } if ($this->option('mysql')) { $this->call("backup:mysql"); } date_default_timezone_set('Europe/Istanbul'); $date = date('d-m-Y_H-i-s', time()); if ($this->option('pack')) { $this->call('backup:pack', [ 'name' => 'backup_' . $date, ]); } if ($this->option('upload')) { if (!$this->option('pack')) { $this->call('backup:pack', [ 'name' => 'backup_' . $date, ]); } $this->call("backup:upload", [ 'name' => 'backup_' . $date . '.tar.gz', ]); } if ($this->option('clean')) { $this->line("|-> Cleaning..."); $files = glob(env('BACKUP_FOLDER') . '/*'); foreach($files as $file){ is_file($file) ? unlink($file) : null; } $files = glob(env('EXPORT_FOLDER') . '/*'); foreach($files as $file){ is_file($file) ? unlink($file) : null; } } $this->line("|-> The backup and upload process is finished."); return; } /** * Define the command's schedule. * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ public function schedule(Schedule $schedule): void { // $schedule->command(static::class)->everyMinute(); } }