summaryrefslogtreecommitdiff
path: root/detonate.sh
diff options
context:
space:
mode:
authordoc <doc@filenotfound.org>2025-06-30 20:11:52 +0000
committerdoc <doc@filenotfound.org>2025-06-30 20:11:52 +0000
commit41e897f4945aaf8fbcdf0b12ac2f08c5e6ae0458 (patch)
treedb7c3520fd91abc3cf56b1a52095d23f3a80d059 /detonate.sh
commit of legacy codeHEADmaster
Diffstat (limited to 'detonate.sh')
-rwxr-xr-xdetonate.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/detonate.sh b/detonate.sh
new file mode 100755
index 0000000..5defdae
--- /dev/null
+++ b/detonate.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# This script finds and blows away directory landmines in a MinIO-mounted filesystem
+# where files are supposed to go but directories already exist. Use with caution.
+
+LOG="/tmp/minio_detonation.log"
+ERROR_LOG="/tmp/rclonemasto-dump.log"
+TARGET_BASE="/assets/minio-data/mastodon"
+
+echo "[*] Scanning for blocking directories... 💣" | tee "$LOG"
+
+grep 'is a directory' "$ERROR_LOG" | \
+awk -F': open ' '{print $2}' | \
+sed 's/: is a directory//' | \
+sort -u | while read -r bad_path; do
+ if [ -d "$bad_path" ]; then
+ echo "[💥] Nuking: $bad_path" | tee -a "$LOG"
+ rm -rf "$bad_path"
+ else
+ echo "[✔️] Skipped (not a dir): $bad_path" | tee -a "$LOG"
+ fi
+done
+
+echo "[✅] All blocking directories removed. Re-run rclone and finish the war." | tee -a "$LOG"