setName('backup:target:remove')
->setDescription('Remove a backup location from NG Backup (the backups on it are kept)')
->addArgument('target', InputArgument::REQUIRED, 'Name or id');
}
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$t = $this->targets->get($input->getArgument('target'));
} catch (\Throwable) {
$output->writeln('No such location.');
return 1;
}
$this->targets->remove($t);
$this->alerts->securityEvent('target_removed', ['target' => $t->getName()]);
$output->writeln('Removed ' . $t->getName() . '. The backups on the location itself were not touched; add it again to use them.');
return 0;
}
}