The disk was fine last month and is at 95% today. On Ubuntu you can fix that on a schedule by hand — a cron entry or a systemd timer that runs the vacuum and cache commands for you — or let CleanMate do it and tell you what it freed. Both approaches work; they differ sharply in what runs, what is shown and what can go wrong.
A hand-written scheduled job
The two safe, standard commands for recurring junk are the journal vacuum and the apt cache clean. In root’s crontab:
sudo crontab -e
# every Sunday at 04:00:
0 4 * * 0 /usr/bin/journalctl --vacuum-time=2weeks && /usr/bin/apt-get clean
journalctl --vacuum-time=2weeks deletes journal entries older than two weeks; apt-get clean deletes the downloaded .deb files in the apt cache — installed software is not touched, and packages are downloaded again if ever needed. Temporary files need no job of their own: systemd-tmpfiles --clean clears /tmp and /var/tmp by age rules, and Ubuntu already runs it daily through its own systemd-tmpfiles-clean.timer.
The costs are real, and worth knowing before you rely on it:
- The job runs as root, with no preview, no confirmation and no Trash: a mistyped flag deletes for good, and a typo in the schedule deletes at the wrong time.
- It runs even on battery, and even while you are presenting or compiling — the vacuum can steal I/O at the worst moment.
- Nothing tells you what was freed: no notification, no log beyond cron’s mail if you read it.
- It knows nothing about your apps: it cannot skip the cache of an app that is running, and it will never clean the caches of browsers, developer tools or AI assistants for you — those need their own entries, each with its own risks.
CleanMate’s automatic cleaning
Settings → Automatic cleaning runs a clean on a schedule — weekly by default, or daily or monthly — of user and developer junk and the caches AI tools rebuild, and then notifies you: “Freed 1.2 GB. Worth a look: Docker build cache 2.0 GB, Google Chrome 1.8 GB.” The notification names the big items it left for you to decide, and Last run shows when it last ran and what it freed.
What it never does matters as much: it never empties the Trash, never touches browsers, apps, AI chat history or models, Docker volumes, stopped containers or project build folders — and it never needs your password. On a laptop it runs only when plugged in; a clean due while on battery waits until you plug it in (Settings → Run even on battery turns this off). A clean that fails or is cut short is retried within the hour, up to three times, and you are notified if it still could not finish.
The low-disk alert
A schedule prevents the junk; a low-disk alert catches everything else. Settings → Low disk alert warns you when / has less than 10% free (you can set 5–20% or Off; at most once a day). While it is on, a daily systemd user timer (cleanmate-check.timer) does the check, and the desktop app checks the disk when it opens and sends the alert itself, so it also reaches you without notify-send. Click the notification to open CleanMate. Check now from the terminal:
cm --check # low disk alert and scan reminder, checked right now
There is also an optional scan reminder (weekly or monthly) for the scanning habit itself. And if you also use the Mac: CleanMate for macOS has no scheduled cleaning — only an optional scan reminder and a low-free-space warning, and every clean waits for you to confirm it.
Related: freeing disk space on Ubuntu, clearing the cache on Ubuntu and the journal, /var/log and the apt cache. CleanMate is free and open source: download it.
FAQ
Will automatic cleaning delete my own files?
No. It cleans regenerable junk — caches, logs, package and developer caches — and the things it never touches (the Trash, browsers, apps, AI models, Docker volumes, build folders) are left out of every scheduled run.
What happens on battery?
A scheduled clean waits until the laptop is plugged in. Run even on battery in Settings turns that off if you want it strict.
Can I see what a run freed?
Yes: the notification says what was freed and names the big items left for you, and Settings → Automatic cleaning → Last run keeps the last result, including why a run failed.
Why not just the cron job?
You can run both. The cron job is precise but blind: root, no preview, no notification. CleanMate runs as your user, shows what it found, stays off the things that hold data, skips the battery and notifies you — and cm --check covers the low-disk warning either way.
