When collecting files for successive reports, one vague instruction can cause duplicate or missing rows. Decide exactly where a file modified at the cutoff belongs. With GNU find, -newer start means strictly after the start. Negating -newer end means at or before the end. Together they select an interval with an open lower edge and a closed upper edge.
Build a reproducible fixture
Use Bash and the GNU implementations of find, touch, and sort. Save the file as window.sh and run bash window.sh in an empty scratch directory. The fixture uses explicit UTC modification times and requires no waiting for the clock to advance.
#!/usr/bin/env bash
set -euo pipefail
mkdir window-demo
cd window-demo
mkdir input
TZ=UTC0 touch -t 202611280900.00 start input/at-start.txt
TZ=UTC0 touch -t 202611280930.00 'input/in window.txt'
TZ=UTC0 touch -t 202611281000.00 end input/at-end.txt
TZ=UTC0 touch -t 202611281000.01 input/late.txt
found=$(find input -type f -newer start ! -newer end -print | LC_ALL=C sort)
test "$found" = $'input/at-end.txt\ninput/in window.txt'
printf '%s\n' "$found"Expected output
input/at-end.txt
input/in window.txtThe file with the same timestamp as start fails the first test. The one equal to end is not newer than it, so it passes the negated test. A file one second later fails. The reference files live outside input, so they cannot appear in the report. Sorting is only for display and test reproducibility. Traversal order itself is not part of the interval rule.
Apply the cutoff deliberately
If the next report uses the old end as its start, a file exactly on the shared boundary belongs to the earlier window. That property concerns the comparisons, not delivery guarantees. A modification timestamp can be preserved by a copy or rewritten, and a live directory can change while you scan it. For jobs that must never miss arrivals, pair the timestamp filter with a stable manifest, snapshot or ingestion checkpoint suited to the application.
If a boundary file seems to disappear, compare the markers’ actual modification times with the candidate’s, including timezone and filesystem precision. Do not substitute change time or creation time for modification time. The line-oriented output is fine for the controlled fixture, including its space in a filename. For arbitrary file names containing newlines, use -print0 and a NUL-aware consumer.
References and related reading: GNU Findutils timestamp comparisons and Java Samples Linux tutorials.