Deleting bobaindex functions : security and performances issues

This commit is contained in:
Djan 2023-08-01 20:13:14 +02:00
parent bcdf2263ee
commit 3f72c6fb83
1 changed files with 0 additions and 55 deletions

View File

@ -225,61 +225,6 @@ function bobadur {
done
}
function bobaindexgeneratelist {
TestBorgRepo
echo "Warning, list of file will be generating OUTSIDE the repo,so it will be in CLEARTEXT."
echo "This could be a securty issue, as it will expose file list of all archives."
echo "Generating list could last a very long time and take some disk space."
read -p "Continue ? [N/y] " CONT
if [ "$CONT" != "y" ];then
return
fi
echo "Generating list..."
indexdir=bobaindex_$(date +%Y%m%d)
mkdir -p $indexdir
for archive in $(borg list --short ./);do
echo "Generating list for $archive"
borg list --short .::"$archive" >> $indexdir/"$archive"
done
echo "Adding index to repo..."
borg create .::bobaindex_$(date +%Y%m%d) $indexdir/
rm -rf $indexdir/
echo "Borg index generated."
}
function bobaindexsearch {
TestBorgRepo
indexarchive=$(borg list --short . | grep bobaindex | head -n 1)
if [ "$1" = "" ];then
echo "No argument.";return
fi
if [ $indexarchive = "" ];then
echo "bobaindex not found";return
fi
if [ ! -d $HOME/$indexarchive ];then
echo "Mounting index..."
mkdir $HOME/$indexarchive
borg mount ./::$indexarchive $HOME/$indexarchive
fi
cd $HOME/$indexarchive
grep -i -r $1 ./
cd -
}
function bobaindexumount {
mountpoint=$(findmnt -l --output TARGET | grep bobaindex)
fusermount -u -z "$mountpoint"
sleep 5
rmdir "$mountpoint"
}
###############################################################################
# mount functions
###############################################################################