💾 Archived View for gmn.clttr.info › sources › geminispace.info.git › tree › infra › rebuild_index.s… captured on 2023-09-08 at 16:29:36.

View Raw

More Information

⬅️ Previous capture (2023-06-14)

🚧 View Differences

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

#!/bin/bash
BASEDIR="$1"
XDG_RUNTIME_DIR="/run/user/1000"
DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"

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

touch "${LOCKFILE}"

mkdir -p "${BASEDIR}/index.new/"
/usr/bin/systemctl --user stop gus
cp "${BASEDIR}/index/gus.sqlite" "${BASEDIR}/index.new/"
/usr/bin/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"
/usr/bin/systemctl --user restart gus

rm "${LOCKFILE}"