Smart ZimaOS Cleanup Script (Safe for System with Backups)

Below is a step-by-step explanation on how to use the script.
Follow it in order and copy-paste the commands exactly.

Step 1 – Check current /DATA usage (before)

df -h /DATA

Step 2 – Create the cleanup script (one-time setup)
Copy and paste the full script into this file:

nano /DATA/clean_zima_storage_safe.sh

Paste the script, save, and exit.

Step 3 – Make the script executable (one time only)

chmod +x /DATA/clean_zima_storage_safe.sh

Step 4 – Run the cleanup (only when you need space)

bash /DATA/clean_zima_storage_safe.sh

Step 5 – Check /DATA usage again (after)

df -h /DATA

What the script does

  • Keeps only the newest backup in /DATA/Backups
  • Removes old backups safely
  • Clears logs in /DATA/.log
  • Cleans cache/temp folders for listed apps under /DATA/AppData
  • Removes unused Docker images and volumes (does not stop running containers)

How to add your own apps
Inside the script, find APPS_TO_CLEAN and add an entry like this:

[paperless-ngx]="/data/tmp /data/cache"

Only add cache or temp paths, never config or main data folders.

If there’s anything you’re not sure about, just ask before running it.