Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coblej/243b379f99c5687bf5867bf919bd3d9f to your computer and use it in GitHub Desktop.
Save coblej/243b379f99c5687bf5867bf919bd3d9f to your computer and use it in GitHub Desktop.
#!/bin/bash
BASE=https://our.dev.hostname:8443/fcrepo/rest/prod
TOTAL=10000
RESOURCE_LIST=items.txt
# top level containers
COLLECTION=`curl -u user:pass -s -XPOST $BASE`
# create resources
for x in $(seq 0 ${TOTAL});
do echo $x;
# collect listing of newly created resources
curl -u user:pass -s -XPOST -H"Content-Type: text/turtle" --data-binary "
@prefix ex: <http://example.org/ont/>.
<> ex:isMemberOfCollection <${COLLECTION}>." $BASE \
>> $RESOURCE_LIST
echo "" >> $RESOURCE_LIST
done
# create versions
for y in `cat $RESOURCE_LIST`;
do echo $y;
curl -u user:pass -s -XPOST -H"slug: v0" $y/fcr:versions
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment