1 files changed,
9 insertions(+),
7 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-07-11 14:23:03 +0300
Authored at:
2026-07-10 18:13:28 +0300
Change ID:
sqonnnlznqqlszvtuouwwoppuxwmvvqk
Parent:
e1f53d7
M
prune.sh
ยทยทยท 33 33 34 34 if [[ -v ACTIVE["$name"] ]]; then 35 35 # Active session: keep the _last target always, prune old others 36 - target="$(readlink "$name"_last 2>/dev/null || true)" 37 - if [ "$f" = "$target" ]; then continue; fi # always keep the _last target 36 + target="$(readlink "${name}_last" 2>/dev/null || true)" 37 + # readlink returns an absolute path; compare basenames only 38 + if [ "$f" = "${target##*/}" ]; then continue; fi 38 39 if [[ "$ts" < "$CUTOFF" ]]; then 39 40 rm "$f" 40 41 echo -e "${RED}pruned:${RESET} $f" 41 42 DELETED=$((DELETED + 1)) 42 43 fi 43 44 else 44 - # Orphaned session: delete everything 45 - rm "$f" 46 - echo -e "${MAGENTA}pruned (orphan):${RESET} $f" 47 - DELETED=$((DELETED + 1)) 48 - ORPHANS=$((ORPHANS + 1)) 45 + if [[ "$ts" < "$CUTOFF" ]]; then 46 + rm "$f" 47 + echo -e "${MAGENTA}pruned (orphan):${RESET} $f" 48 + DELETED=$((DELETED + 1)) 49 + ORPHANS=$((ORPHANS + 1)) 50 + fi 49 51 fi 50 52 done 51 53