Conscious filesystem diff, audit & sync tool
Explicit > Blind
Auditable > Convenient
Engineering > Copy & paste
fsync-conscious is a conscious directory diff, audit, and sync tool.
It exists because copying and pasting folders is a blind operation.
This project is built on a simple principle:
Never sync what you donβt understand.
Before applying any change, fsync:
- computes explicit diffs
- classifies risks
- detects real filesystem errors
- generates auditable reports
- fails honestly when needed
Common tools (cp, GUIs, copy/paste):
- silently overwrite files
- donβt explain what changed
- donβt detect unreadable files
- break on sockets, permissions, and mounts
- are not auditable
fsync-conscious treats the filesystem as state, not just a pile of files.
- Explicit diff before sync
- Clear policy > implicit behavior
- Failures are classified, not hidden
- Dry-run must produce the SAME report as a real sync
- Hashing is optional, not dogma
- Nothing is renamed or βfixedβ automatically
fsync-conscious is OS-aware but not OS-abstracted.
- Linux (ext4, xfs, btrfs, ZFS, network mounts, Docker volumes)
Linux is the primary target platform and the environment where all features are guaranteed.
- macOS
Most functionality works as expected, but behavior depends on:
- filesystem (APFS / HFS+)
- permission model
- extended attributes
Use with care on production or critical data.
- Windows (native)
Reason:
- incompatible filesystem semantics
- different permission model
- path and filename rules differ fundamentally
Running under WSL (Windows Subsystem for Linux) is supported,
since the tool then operates on a Linux filesystem layer.
pip install fsync-consciousThis installs the fsync CLI globally.
git clone https://github.com/<your-user>/fsync-conscious.git
cd fsync-conscious
pip install -e .All commands follow this pattern:
fsync <mode> <A> <B> [options]Where:
- A β source directory (source of truth)
- B β destination directory (backup / mirror)
Shows what is different between A and B. Does not create, copy, or delete anything.
fsync diff A BDetects:
- missing directories
- new files
- modified files
- extra files in the destination
Updates B based on A.
fsync sync A BBy default:
- nothing is deleted
- only new or updated files are copied
- invalid entities are ignored
- execution continues even if some errors occur
Verifies whether A and B are equivalent.
fsync check A B- exit code
0β identical - exit code
1β differences found
Ideal for CI, sanity checks, and automated audits.
By default, comparison is based on:
- file existence
- modification timestamp (
mtime)
fsync sync A BAdvantages:
- fast
- low I/O
- no need for file read permissions
- robust for 99% of real-world cases
Enables content-based comparison.
fsync diff A B --hashBehavior:
- reads full file contents
- detects any real content change
- unreadable files are marked as
UNREADABLE
Simulates the entire operation without writing anything.
fsync sync A B --dry-runImportant:
- the generated report is IDENTICAL to a real sync
- only side effects are suppressed
Any error becomes a fatal error.
fsync sync A B --strict-fsAborts on:
- unreadable files
- invalid filenames for the target filesystem
- write errors
- mount incompatibilities
Ideal for CI and critical backups.
Generates a final report + explicit exit code.
fsync sync A B --dry-run --audit-onlyExample output:
AUDIT REPORT
copied: 214
skipped: 0
unreadable: 2
invalid: 1
fsync classifies everything into four categories:
| Category | Meaning |
|---|---|
copied |
files copied (or that would be copied in dry-run) |
skipped |
ignored by policy |
unreadable |
could not be read |
invalid |
invalid name/path for the destination filesystem |
π Nothing is silent.
Inspired by rsync:
| Code | Meaning |
|---|---|
0 |
total success |
1 |
differences found |
10 |
skipped files |
20 |
unreadable files |
30 |
invalid files |
99 |
fatal error (--strict-fs) |
fsync sync A B --deleteRemoves from the destination everything that no longer exists in the source.
fsync diff A B --reverseEquivalent to:
B β A
- sockets (
mysql.sock) - FIFOs
- device files
- broken symlinks
- files removed during scan
Filesystems are heterogeneous. The tool explicitly assumes this.
- conscious incremental backups
- backup validation
- laptop β external drive
- staging β production
- data audits
- CI/CD pipelines
- Docker environments
- mounted volumes
- critical data sets
- one-off disposable copies
- trivial tasks
- non-technical users
- when convenience > control
Copy & paste solves an action. fsync solves a process.
This tool exists for people who need to:
- understand what is happening
- take responsibility
- audit decisions
- avoid silent data loss
MIT β use, modify, and distribute freely. But understand what you are doing.