Fleet reporting

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 --json

Without 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.

FieldValueScans
capacity-bytesVolume capacityNo
used-bytesBytes in useNo
free-bytesFree bytesNo
purgeable-bytesBytes macOS can free on demandNo
cloud-locationsNumber of cloud storage foldersNo
last-scanStart of the latest saved scan, ISO 8601 UTCNo
reclaimable-bytesEstimated reclaimable bytesYes
largest-folderPath of the heaviest folderYes

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-bytes

Power 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-run prints the plan and changes nothing. It works even when ReportOnly is 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.
  • ReportOnly blocks it (exit code 3); DisabledRuleCategories and DisableCloudEviction are honored.

Exit codes

CodeMeaning
0Success
1Error (I/O problem, scan failure, app not installed)
2Usage error (unknown command or option, invalid policy file)
3Blocked by an administrator policy
4The licence doesn’t include the feature
130Interrupted