setName('backup:pause-jobs') ->setDescription('Show or set whether heavy background jobs (Memories, Recognize, Preview Generator, ...) pause while a backup runs') ->addArgument('setting', InputArgument::OPTIONAL, '"on" or "off"; omit to show the current one'); } protected function execute(InputInterface $input, OutputInterface $output): int { $setting = $input->getArgument('setting'); if ($setting !== null) { if ($setting !== 'on' && $setting !== 'off') { $output->writeln('Use "on" or "off".'); return 1; } $this->pause->setEnabled($setting === 'on'); } $status = $this->pause->status(); $output->writeln('Pausing heavy background jobs during a backup: ' . ($status['enabled'] ? 'on' : 'off')); if ($status['jobs'] !== []) { $output->writeln('Paused now: ' . implode(', ', $status['jobs'])); } return 0; } }