Skip to content
sganisPublic

About

Walk file systems and collect stats.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Dutopia CI

Dutopia

A Rust Toolkit for High-Scale Filesystem Analytics

Dutopia turns massive filesystems into fast, filterable, UTF-8 clean analytics.
It is modular — use only the components you need.


Components

  • duscan — high-performance scanner that traverses the filesystem with concurrency and streams metadata for both files and directories.
  • duhuman — converts machine data (epochs, uids/gids, mode bits) into human fields (local dates, usernames, octal perms).
  • dusum — reads duscan output and produces rollups by folder, user, and file-age buckets.
  • dudb — builds the SQLite database from dusum output; with --raw it also indexes each folder's files (totals of all of them, listing the 100 largest of at least 1 MB per folder, owner and age by default) so listings need no filesystem access.
  • duzip — compresses/expands CSV ↔ Zstandard (.zst) binary streams.
  • duapi — lightweight REST API server exposing aggregated data.
  • duxray — one-pass statistics over a duscan CSV: size distribution, age and abandonment by owner and project, junk files, permission red flags.

Frontend: Svelte SPA (for dashboards and visualization).


Features

  • Multi-threaded Rust scanner with near-line-rate performance.
  • Output as CSV or binary (Zstandard optional).
  • UTF-8 safe, cross-platform (Linux, macOS, Windows).
  • Scales to billions of files (tested on >1B files, 30PB storage).
  • Aggregated indices for instant dashboard queries.
  • Works standalone or as a full pipeline.

Output

Scanner output (CSV):

INODE,ATIME,MTIME,UID,GID,MODE,SIZE,DISK,PATH

Columns:

  1. INODE — device identifier + inode (Linux)
  2. ATIME — last access time (epoch seconds)
  3. MTIME — last modified time (epoch seconds)
  4. UID — user ID
  5. GID — group ID
  6. MODE — file type + permissions (octal)
  7. SIZE — logical size in bytes
  8. DISK — disk usage (blocks × 512)
  9. PATH — full path (UTF-8 safe)

Build

Clone and build with Cargo:

git clone https://github.com/sganis/dutopia.git
cd dutopia
cargo build --release

Binaries are under target/release/:

  • duscan
  • duhuman
  • dusum
  • dudb
  • duzip
  • duapi
  • duxray

Run Examples

Scan (walk filesystem)

./duscan /home -o home.csv

Humanize (optional)

./duhuman home.csv -o home.human.csv

Aggregate

./dusum home.csv -o home.sum.csv

Build database

# folder-level stats only
./dudb home.sum.csv -o home.db

# also index every file, so /api/files is served from the DB
# (required in production where the API host cannot see the filesystem;
#  run on a host that resolves the same uid→username mapping as dusum)
./dudb home.sum.csv --raw home.csv -o home.db

The file index costs ~52 bytes per file; the resulting DB is roughly half the size of the raw scan CSV (e.g. a 50 GB scan builds a ~23 GB DB).

Compress / Decompress

# compress CSV → Zstd
./duzip home.csv -o home.zst

# decompress Zstd → CSV
./duzip home.zst -o home.csv

Serve API

./duapi home.db --port 8000

Open the Svelte frontend in your browser to explore results.


Deploy

On-prem OpenShift: build on a Linux host, package into a thin image, push, apply. Full runbook in deploy/README.md.

./deploy/build-linux.sh                                   # on the Linux host
podman build -f deploy/Dockerfile -t <registry>/duapi:<v> .
oc apply -f deploy/openshift/duapi.yaml

Contribute

Fork and submit PRs:

git clone https://github.com/sganis/dutopia.git

About

Walk file systems and collect stats.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages