Add script for moving GraphDB
This commit is contained in:
parent
7ce5709037
commit
b0170a7611
1 changed files with 16 additions and 0 deletions
16
misc/dump_graphdb.sh
Normal file
16
misc/dump_graphdb.sh
Normal 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"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue