Add script for moving GraphDB

This commit is contained in:
Tom Wiesing 2020-06-16 11:55:00 +02:00
parent 7ce5709037
commit b0170a7611
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15

16
misc/dump_graphdb.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash
DATE=`date +%Y%m%dT%H%M%S`
mkdir $DATE
mkdir $DATE/graphdb
curl -X GET -H "Accept:application/n-quads" "http://localhost:7200/repositories/SYSTEM/statements?infer=false" > "$DATE/graphdb/SYSTEM.nq"
for REPO in `grep -oP '(?<=#repositoryID> ")[^"]+' $DATE/graphdb/SYSTEM.nq`; do
echo "dumping $REPO ..."
curl -X GET -H "Accept:application/n-quads" "http://localhost:7200/repositories/$REPO/statements?infer=false" > "$DATE/graphdb/${REPO}.nq"
done
tar cfz "$DATE.tgz" "$DATE/"
rm -r "$DATE"