From b0170a7611f83ff657a74bf201a6f195bc2760b9 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Tue, 16 Jun 2020 11:55:00 +0200 Subject: [PATCH] Add script for moving GraphDB --- misc/dump_graphdb.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 misc/dump_graphdb.sh diff --git a/misc/dump_graphdb.sh b/misc/dump_graphdb.sh new file mode 100644 index 0000000..e242d8a --- /dev/null +++ b/misc/dump_graphdb.sh @@ -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" \ No newline at end of file