dux report (Business) prints a summary of a Mac’s disk for your
management tool. It runs headless, asks nothing, and needs no window.
JSON
dux report --json
dux report /Users/alex --jsonWithout paths it scans the folders set by ScanRoots, or the home
folder of the person running it. Run as root, it never falls back to
a home folder: give the folders explicitly.
The JSON holds the volume capacity, free and purgeable space,
reclaimable bytes per category, the largest folders, the cloud
locations and the time of the last scan. Every JSON document carries
schemaVersion (currently 1). Fields are added without changing the
version; it increases only when a field is removed or changes meaning.
Keys are sorted, dates are ISO 8601 in UTC, sizes are bytes.
Extension attributes
--extension-attribute <field> prints one value as
<result>value</result>, the format Jamf extension attributes read.
The same output works as an Intune custom attribute script.
| Field | Value | Scans |
|---|---|---|
capacity-bytes | Volume capacity | No |
used-bytes | Bytes in use | No |
free-bytes | Free bytes | No |
purgeable-bytes | Bytes macOS can free on demand | No |
cloud-locations | Number of cloud storage folders | No |
last-scan | Start of the latest saved scan, ISO 8601 UTC | No |
reclaimable-bytes | Estimated reclaimable bytes | Yes |
largest-folder | Path of the heaviest folder | Yes |
Fields that need no scan return right away. An unavailable value prints an empty result. A Jamf extension attribute script:
#!/bin/sh
"/Applications/dux.app/Contents/Helpers/dux" \
report --extension-attribute free-bytesPower BI
deploy/powerbi/dux-fleet-report.pq in the source repository is a
Power Query script for Power BI Desktop. It loads a folder of
dux report --json files (one per Mac, as your management tool
collects them) or a single JSON array, and produces a table per Mac
(capacity, used, free, purgeable, reclaimable per category) and a long
table of the largest folders. deploy/powerbi/README.md has the steps
(Get Data > Blank Query > Advanced Editor) and suggested visuals.
What leaves each Mac with the report: the scanned root paths and the
paths of the largest folders (they contain the user name) and, per
cloud location, the provider and the account name as the client shows
it. No hostname or serial number; your management tool adds those.
Add --no-paths to keep the user name and the account names on the
Mac: paths inside the home folder are written as ~/..., paths outside
it stay as they are, and the account field is left out. The option
also applies to --extension-attribute largest-folder.
Cleanup policies
dux clean --policy FILE applies a cleanup policy from your own
scripts. A policy names rule IDs and the riskiest safety level allowed:
{
"schemaVersion": 1,
"rules": ["xcode.derived-data", "npm.cache"],
"maxSafety": "safe",
"roots": ["~"],
"minimumBytes": 104857600
}--dry-runprints the plan and changes nothing. It works even whenReportOnlyis enforced.- Without
--dry-run, the tool asks on a terminal. In a script, it refuses unless you add--yes. - Files go to the Bin or become clones; every action is logged and can be undone from the app’s Activity.
ReportOnlyblocks it (exit code 3);DisabledRuleCategoriesandDisableCloudEvictionare honored.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (I/O problem, scan failure, app not installed) |
| 2 | Usage error (unknown command or option, invalid policy file) |
| 3 | Blocked by an administrator policy |
| 4 | The licence doesn’t include the feature |
| 130 | Interrupted |