System cleaner for Zainium OS and other Linux-based systems. Operates as a
standalone cleanup tool: it does not invoke distribution package managers by
default and discovers cleanup targets at runtime. It focuses on safe,
configurable cleanup and provides a non-destructive --dry-run mode.
sweep [--dry-run] [--aggressive] [--save-config]
| Flag | Description |
|---|---|
--dry-run / -d |
Preview what would be cleaned without deleting anything (disabled destructive actions) |
--aggressive / -a |
Enable aggressive cleanup (larger cache windows) |
--save-config |
Persist current flags to ~/.config/zai-sweep/config.toml |
- Runtime-discovered temp directories (e.g.
/tmp,/var/tmp,/dev/shm). - Runtime-discovered cache directories (e.g.
$XDG_CACHE_HOME,/var/cache). - Runtime-discovered log directories (e.g.
/var/log,/var/log/journal). - User
Downloadspartial files (*.part,*.crdownload,*.tmp). - If present, system coredumps (e.g.
/var/lib/systemd/coredump). - Optional project-specific roots (e.g.
/zai-sys) only when present or configured.
Notes:
- The tool avoids hardcoded package-manager commands by default; package-manager cache cleaning is intentionally omitted to keep the tool standalone. Host-specific integrations may be added as opt-in adapters.
- Destructive operations are skipped in
--dry-run. - Safety:
is_safe_to_deleteuses a combination of hard-safe prefixes, userextra_paths(supports glob patterns), and device-match checks to avoid deleting files on unrelated mount devices.
Space freed is measured by comparing du -sb snapshots of target directories
before and after cleanup — real numbers, not estimates.