💾 Archived View for gmn.clttr.info › sources › geminispace.info.git › tree › infra › rebuild_index.s… captured on 2024-02-05 at 10:06:02.
⬅️ Previous capture (2023-09-08)
-=-=-=-=-=-=-
#!/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}"