Darsh Mahadevia
all projects

FileKeeper

A Python CLI that finds duplicate files, previews cleanup, and quarantines extra copies so you can restore them later.

Duplicate-file detection and recoveryPython · SQLite · SHA-256 · GitHub Actions
FileKeeper demo output finding one duplicate group, quarantining the extra copy, and restoring it.
The repository demo shows a complete scan, quarantine, and restore cycle with sample files.view full size in a new tab

Overview

FileKeeper finds files with identical contents, even when their names differ. It groups files by size, compares SHA-256 hashes, and can cache hashes in SQLite for later scans. Cleanup starts as a preview. Applying it moves extra copies into quarantine and records their original paths. Quarantine keeps the files on disk, so it does not free storage space.

What I built

  • Filtered by file size before hashing candidates in fixed-size chunks. Optional SQLite caching reuses a hash only when the file metadata still matches.
  • Made cleanup preview its plan before moving files. Each cleanup records a manifest, and restore refuses to overwrite an existing file.
  • Added checkpoints and per-root filesystem locks so interrupted cleanup or restoration can resume. Recovery checks inode identities when a process exits partway through a move.
  • Tested duplicate detection, cache invalidation, restore conflicts, and forced process exits after linking, checkpointing, and unlinking files.
Next projectVoco