08-maintenance.sh
Status: Recommended
Periodic maintenance script for keeping your MacBook Air 2020 (MacBookAir9,1) running CachyOS in healthy shape. It covers system upgrades, T2 hardware checks, storage maintenance, and developer environment readiness.
Usage
bash
sudo bash scripts/08-maintenance.sh [--dry-run] [--help]| Flag | Description |
|---|---|
--dry-run | Preview all actions without modifying the system |
--help | Show usage information and exit |
What It Does
- System Upgrade — ranks mirrors (skipped if mirrorlist is less than 24 hours old), then runs a full
paru -Syu(oryay/pacmanfallback) as the real user viarunuser. - T2 Hardware Health — read-only checks:
apple_bcemodule loaded,mbpfanservice active, fan speed from sysfs. - SSD TRIM — runs
fstrim -vaon all mounted volumes. - Package Cache Cleanup — keeps 2 versions of installed packages (
paccache -rk2) and removes all cached uninstalled packages (paccache -ruk0). Skips gracefully ifpaccacheis not installed. - Orphan Removal — detects and removes orphaned packages (
pacman -Qtdq). Skips if none found. - Failed Systemd Units — read-only scan for any failed units.
- Journal Vacuum — cleans journal entries older than 3 days.
- Limine Bootloader Integrity — read-only verification of
limine.conf, kernel entry, andlimine-entry-toolavailability. - Git Signing Readiness — read-only check of GPG agent, signing key, and
commit.gpgsignfor the real user.
Prerequisites
- Root access (run with
sudoor viamake maintenance). - An AUR helper (
paruoryay) for system upgrades. pacman-contribfor package cache cleanup (paccache).
Source
View the full source on GitHub.