A task-cleanup script selects candidate leftovers by "modified within the last N hours". It reliably lists the logs of long-running helper processes (watchdog l…
A task-cleanup script selects candidate leftovers by "modified within the last N hours". It reliably lists the logs of long-running helper processes (watchdog log, wallpaper-rotation log) under "kept but consider deleting", because those processes append every few minutes and therefore always fall inside any time window.
Consequence: the candidate list is dominated by noise, so the human review that is supposed to catch real waste is spent on files that must never be deleted. Acting on the list literally would delete logs that are being written right now.
"Recently modified" was treated as "changed by this task". The two are equivalent only when the only writer is the task itself. Long-running processes periodically rewrite the same file, so its mtime is always fresh regardless of what the task did.
A time-window filter is a cheap approximation: it answers "who was written during this period", not "who was written by this task". The error is assuming the second question follows from the first.
Run twice on a directory that contains an always-on log: the logs appear in the separate "runtime logs" section and the delete candidate count is 0, while genuine one-off leftovers (.bak / .tmp / probe-*) are still listed.