Compare commits

..
1 Commits
Author SHA1 Message Date
clawbot 53c51e0149 Leave removed copies out of report and trees (closes #173)
check / check (push) Canceled after 0s
A deleted duplicate stayed in both reports until a scan covered it, and
a missing scan operand is a fatal error. report now runs lstat on each
path of a possible duplicate group and drops paths that are gone; trees
does the same for the directory at the top of each copy, never the
files inside. A group left with one copy is not reported. Only "does not
exist" and "not a directory" count as gone, so a permission error keeps
the copy for an unprivileged user. README says a stale report is fixed
by scanning again, and its Docker example mounts the scanned tree for
report too.

Model: opus-5-5
2026-11-11 03:54:42 +00:00
+4 -3
View File
@@ -99,13 +99,15 @@ Each `-v` flag below makes a bind mount, which shows a host directory at a path
inside the container. Bind-mount `/var/lib/sfdupes` to keep the database between inside the container. Bind-mount `/var/lib/sfdupes` to keep the database between
runs. Mount the tree to scan at the same path inside the container as on the runs. Mount the tree to scan at the same path inside the container as on the
host. Read-only access is enough. The database then records the host's paths, host. Read-only access is enough. The database then records the host's paths,
and so do the reports. and so do the reports. `report` and `trees` need that mount too. Without it,
every recorded path counts as gone, and each report holds only its header line.
```sh ```sh
make docker make docker
docker run --rm -v /srv:/srv:ro -v /var/lib/sfdupes:/var/lib/sfdupes \ docker run --rm -v /srv:/srv:ro -v /var/lib/sfdupes:/var/lib/sfdupes \
sfdupes scan /srv sfdupes scan /srv
docker run --rm -v /var/lib/sfdupes:/var/lib/sfdupes sfdupes report > dupes.tsv docker run --rm -v /srv:/srv:ro -v /var/lib/sfdupes:/var/lib/sfdupes \
sfdupes report > dupes.tsv
``` ```
### Daily scan from `cron` ### Daily scan from `cron`
@@ -738,7 +740,6 @@ when they hold the same relative paths, and each path holds a file with the same
signature in both. It rebuilds the directory tree from the paths in the records, signature in both. It rebuilds the directory tree from the paths in the records,
split on `/`. Like `report`, it never opens a scanned file. It checks only that split on `/`. Like `report`, it never opens a scanned file. It checks only that
the directory at the top of each copy still exists, as `report` checks a path. the directory at the top of each copy still exists, as `report` checks a path.
It looks at no file or directory inside a copy.
Definitions: Definitions: