Files
zkldi_Tachi/.scripts/make-datadumps.sh
T
zk edda03e916 sunday 5th apr (rip mark hollis) (#52)
* lots of work

* feat: move rg-stats in, ensure consistency in db queries

* the clocks dont work

* almost

* ok jesus been and gone now back to usual
2026-04-06 01:25:30 +01:00

28 lines
822 B
Bash
Executable File

#!/bin/bash
# a script for making tachi's anonymised datasets.
# designed to run on my machine
#
# you are expected to have pnpm, mongo etc. in path.
set -eox pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR";
cd ../server;
# stuff based on my local system, modify as wished
remote_port=12345
target=../../tachi-datasets/datasets
for kind in "kamai" "boku"; do
mongosh --eval "use anon-$kind" --eval "db.dropDatabase()"
mongodump --archive --port=$remote_port --db=$kind | mongorestore --archive --nsFrom="$kind.*" --nsTo="anon-$kind.*"
ts-node src/scripts/anonymise-db localhost:27017/anon-$kind
TCHIS_CONF_LOCATION=$kind.dataset.conf.json5 bun run set-indexes
mongodump --db=anon-$kind --archive="$target/anon-$kind-$(date +%Y-%m).dump" --gzip
done;