option('pause')) { $archive->pauseSweep(); $this->info('Orphan-Sweep ausgesetzt. Fortsetzen mit archive:sweep-orphans --resume (nach archive:reregister).'); return self::SUCCESS; } if ($this->option('resume')) { $archive->resumeSweep(); $this->info('Orphan-Sweep wieder aktiv'.(config('archive.sweep_paused') ? ' — ARCHIVE_SWEEP_PAUSED hält ihn weiterhin an.' : '.')); return self::SUCCESS; } $result = $archive->sweepOrphans((bool) $this->option('dry-run'), max(1, (int) $this->option('hours'))); if ($result['paused']) { $this->warn('Orphan-Sweep ausgesetzt (Restore-Abgleich oder ARCHIVE_SWEEP_PAUSED) — nichts verschoben. Fortsetzen mit --resume.'); return self::SUCCESS; } $this->info(sprintf( '%s: %d Dateien geprüft, %d verwaist, %d in Quarantäne, %d entfernt; Quarantäne abgelaufen: %d.', $this->option('dry-run') ? 'Trockenlauf' : 'Bereinigung', $result['scanned'], $result['orphans'], $result['quarantined'], $result['removed'], $result['expired'], )); return ! $this->option('dry-run') && $result['orphans'] > $result['quarantined'] + $result['removed'] ? self::FAILURE : self::SUCCESS; } }