Files
felhom.eu/documentation/audits/media-build-2026-10-15/tools/filesig.py
T

15 lines
721 B
Python

#!/usr/bin/env python3
"""filesig.py <out-label> — the safety baseline: every regular file under each drive's userdata/media with size, inode,
link count and mtime, one line each, sorted. Run INSIDE the guest. Two runs compared = 'did any FILE change or vanish'
(the Part 2 STOP condition), as opposed to a library entry."""
import glob, os
for root in sorted(glob.glob("/mnt/felhom-drives/*/userdata/media")):
for dp, dn, fn in os.walk(root):
for f in fn:
p = os.path.join(dp, f)
try:
s = os.lstat(p)
except OSError as e:
print(f"ERR {p} {e}"); continue
print(f"{p}\t{s.st_size}\t{s.st_ino}\t{s.st_nlink}\t{int(s.st_mtime)}")