Files
defrag/README.md
2025-12-13 11:56:06 +01:00

2.2 KiB

Hier is je extreme short, sharp, architectural versie — volledig gecomprimeerd, professioneel, helder. Bron verwerkt uit je bestand


Disk Reorganizer — Architectural Summary

Core Outcome

Migration from SQLite → PostgreSQL completed. System is now network-capable, auditable, scalable, and offers real-time operational telemetry.


Architecture

Database Layer (PostgreSQL)

  • Central DB: disk_reorganizer_db
  • User: disk_reorg_user
  • Tables: files, operations
  • Features: indexes, triggers, conflict-upserts, audit fields
  • Deployment: SQL + Windows/Linux setup scripts

Application Layer

  • Python driver migrated to psycopg2
  • Unified DB config + connection pooling
  • Refactored CRUD + batch commits
  • Robust error handling + transactional execution

Operational Layer

  • Dynamic in-screen logging during indexing + migration

    • File/sec, GB processed, ETA, success/error counters
    • Clean single-line, non-spamming UI updates

Workflow

  1. Setup
     {
  "host": "192.168.1.159",
  "port": 5432,
  "database": "disk_reorganizer_db",
  "user": "disk_reorg_user",
  "password": "heel-goed-wachtwoord"
}
./setup_database.sh      # or setup_database.bat
pip install -r requirements.txt
  1. Index

    python app/main.py index "D:\\" disk_d
    
  2. Plan

    python app/main.py plan disk_d disk_e
    
  3. Dry-Run

    python app/main.py execute plan.json --dry-run
    
  4. Execute

    python app/main.py execute plan.json
    
  5. Report

    python src/main.py report
    

Guarantees

  • No destructive actions by default
  • Originals preserved
  • Every action logged in DB
  • Error-resilient, continues safely
  • Suitable for millions of file records

Failure Points to Check

  • PostgreSQL reachable on 5432
  • Correct credentials
  • Disk permissions
  • Python + psycopg2 installed

Essence

A lean, safe, high-visibility disk migration tool running on a proper relational backbone, engineered for clarity, scale, and operational certainty.

Wil je ook een ultrakorte executive one-pager of een diagram-versie?