我有一个输出一些行的命令:
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->line('');
$this->info('--------------------------------------------------------');
$this->info('----------------- Compress documents -------------------');
$this->info('--------------------------------------------------------');
$this->line('');
$progressBar = $this->output->createProgressBar(3);
$this->info('Selecting files...');
// ...
$progressBar->advance();
$this->info('Processing...');
// ...
$progressBar->advance();
$this->info('Moving files...');
// ...
$progressBar->advance();
$this->info('--------------------------------------------------------');
$this->info('------------------------ Result ------------------------');
$this->info('--------------------------------------------------------');
// ...
$this->info('Output quality: '.$resolution.'%');
$this->info('Processed files: '.sizeof($files));
$this->info('Original size: '.number_format($originalPathSize, 3).'MB');
$this->info('Compressed size:'.number_format($compressedPathSize, 3).'MB');
$this->info('Improvement: '.number_format($compressedPathSizeDiff, 3).'MB ('.number_format($compressedPathSizeDiffPercent, 3).'%)');
$this->info('Total time: '.$timeFormatted);
// ...
$this->table($headers, $rows);
$this->info('Ready!');
}
它就像一个魅力。
问题是,现在我需要在生产服务器(通过 SSH)中运行此命令,并且处理所有文件必须花费几个小时。显然我不想在此期间保持登录状态以查看控制台输出。
正如调度任务一样,有什么方法可以“自动”将控制台命令输出写入日志文件?
慕标5832272
桃花长相依