💾 Archived View for gmn.clttr.info › sources › geminispace.info.git › tree › infra › rebuild_index.s… captured on 2023-06-14 at 14:31:25.

View Raw

More Information

⬅️ Previous capture (2023-04-20)

➡️ Next capture (2023-09-08)

🚧 View Differences

-=-=-=-=-=-=-

#!/bin/bash
BASEDIR="$1"

cd "${BASEDIR}"
LOCKFILE="${BASEDIR}/crawl.lock"

touch "${LOCKFILE}"

mkdir -p "${BASEDIR}/index.new/"
systemctl --user stop gus
cp "${BASEDIR}/index/gus.sqlite" "${BASEDIR}/index.new/"
systemctl --user start gus
/home/gus/.local/bin/poetry run build_index -d
mv "${BASEDIR}/index" "${BASEDIR}/index.old"
mv "${BASEDIR}/index.new" "${BASEDIR}/index"
systemctl --user restart gus

rm "${LOCKFILE}"