Compare commits

1 Commits
Author SHA1 Message Date
sneak e4cb0a8430 Document install, a daily cron scan and reading the reports (closes #54)
check / check (push) Failing after 2s
Getting Started gains three parts: installing with go install, from a
clone or as the Docker image; a crontab line for a daily root scan,
with where its stderr and failures go; and how to read the two reports,
why a row is a candidate rather than proof, and how to check a pair
with cmp before removing anything. The usage block names --help, and
the text below it --workers and -x.

The install line uses @main, not @latest: @latest resolves to the
v0.0.1 tag, which predates the database.

Model: opus-5-5
2026-10-04 08:09:04 +00:00
+7 -10
View File
@@ -109,9 +109,9 @@ read is skipped with a warning and loses its database record (see
skips, and the summary line (see "Progress" and "`scan` mode"). The skips, and the summary line (see "Progress" and "`scan` mode"). The
log grows with every scan; rotate it like any other. log grows with every scan; rotate it like any other.
- Skipped paths do not fail a scan: it still exits 0, and cron sends - Skipped paths do not fail a scan: it still exits 0, and cron sends
nothing. A scan that fails, or is stopped by `SIGINT` or `SIGTERM`, nothing. A scan that fails, or is stopped by a signal, exits 1 with
exits 1 with the reason among the last lines of the log; `tail` the reason among the last lines of the log; `tail` prints them, and
prints them, and cron mails them to root if the host can send mail. cron mails them to root if the host can send mail.
- A scan still running when the next one starts carries on. The new - A scan still running when the next one starts carries on. The new
one fails at once, and the lines cron mails include one fails at once, and the lines cron mails include
`sfdupes: another scan is running (lock held on /var/lib/sfdupes/db.sqlite.lock)`. `sfdupes: another scan is running (lock held on /var/lib/sfdupes/db.sqlite.lock)`.
@@ -126,8 +126,8 @@ Each row of `report` names two copies of one file, and each row of
`trees` two copies of one directory tree (see "Report output format" `trees` two copies of one directory tree (see "Report output format"
and "Trees output format"). In a group of copies, the path that sorts and "Trees output format"). In a group of copies, the path that sorts
first byte by byte is `first` and every other path is a `dupe` of it. first byte by byte is `first` and every other path is a `dupe` of it.
`first` says nothing about which copy is the original or the oldest; `first` is not the original or the oldest copy; which copy to keep is
which copy to keep is your choice. your choice.
A row is a candidate, not proof: A row is a candidate, not proof:
@@ -154,13 +154,10 @@ frees nothing.
A path holding a backslash, tab, newline or carriage return is escaped A path holding a backslash, tab, newline or carriage return is escaped
in the reports (see "Report output format"). Undo the escapes before in the reports (see "Report output format"). Undo the escapes before
using it. `printf '%b'` does exactly that, because every backslash in using it. `printf '%b'` does exactly that, because every backslash in
an escaped path starts one of the four escapes. Command substitution an escaped path starts one of the four escapes:
drops trailing newlines, so print an `x` after the path and remove it
afterwards, or a path that ends in a newline names a different file:
```sh ```sh
p="$(printf '%bx' '/srv/a/tab\tname.txt')"; p="${p%x}" cmp "$(printf '%b' '/srv/a/tab\tname.txt')" /srv/b/tab-copy.txt
cmp "$p" /srv/b/tab-copy.txt
``` ```
Check a `trees` row with `diff -r`, which compares the two trees file Check a `trees` row with `diff -r`, which compares the two trees file