From 42daa97e3408e069a767a9e7bfbd8518cf6ec0f4 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 8 Mar 2025 17:35:11 +0200 Subject: Tiny tool to export /zarchive from IPFS --- tidy_history.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 tidy_history.sh diff --git a/tidy_history.sh b/tidy_history.sh new file mode 100755 index 0000000..ec346e6 --- /dev/null +++ b/tidy_history.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +source lib/_ak_fm +source lib/_ak_script + +tmp=$(_ak_make_temp_file) + +ipfs files ls -l /zarchive >> $tmp +ak ipfs -r files ls -l /zarchive >> $tmp + +_ak_fm_sort_uniq_file $tmp + +cat $tmp | grep -v '/' | awk '{print $1 " " $2 }' | while read ttt hhh +do + trt="$(echo -n ${ttt} | cut -d '-' -f 1)" + trh="$(echo -n ${ttt} | cut -d '-' -f 2)" + if [ -n "${trh}" ] && [ "${trh}" == "${hhh}" ] + then + echo "${trt} ${hhh}" + else + echo "Hash not exist in filename" >&2 + echo "${trt} ${hhh}" + fi +done > $AK_ZLATEST_HISTORY + +rm $tmp -- cgit v1.2.3