setName('cron:schedule'); } protected function execute(Input $input, Output $output) { if ('\\' == DIRECTORY_SEPARATOR) { $command = 'start /B "Niushop Schedule" "' . PHP_BINARY . '" think cron:run'; } else { $command = 'nohup "' . PHP_BINARY . '" think cron:run >> /dev/null 2>&1 &'; } $process = Process::fromShellCommandline($command); $output->writeln('['.date('Y-m-d H:i:s').'] Schedule:start'); while (true) { $process->run(); sleep(60); } } }