From c27e8e905c29750c9ab1cbe684b2733e5347c4b4 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Tue, 16 Jan 2024 12:24:42 -0800 Subject: [PATCH] tools: check missing snapshot link targets in link checker tool --- tools/checksnapshotlinks.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/checksnapshotlinks.sh b/tools/checksnapshotlinks.sh index e37b1d2ef..5f7e1cea9 100755 --- a/tools/checksnapshotlinks.sh +++ b/tools/checksnapshotlinks.sh @@ -58,3 +58,14 @@ find -L /backingfiles/snapshots/ -type f -name \*.mp4 | sort -r | { fi done } + +find /mutable/TeslaCam -xtype l | { + while read -r path + do + echo "link target for '$path' does not exist" + if [ "$REPAIR" = "true" ] + then + rm "$path" + fi + done +}