Skip to content

Instantly share code, notes, and snippets.

@mbklein
Last active June 7, 2018 17:25
Show Gist options
  • Save mbklein/b3cfae59a792656a9943daade550b0ea to your computer and use it in GitHub Desktop.
Save mbklein/b3cfae59a792656a9943daade550b0ea to your computer and use it in GitHub Desktop.
Delete all of a Fedora container's contained resources without blocking
#!/bin/bash
RESOURCE=http://fcrepo.mbk.vpc.devops-test.library.northwestern.edu/rest/nuf
curl -s -N -H accept:application/n-triples $RESOURCE \
| grep 'ldp#contains' \
| sed 's/^.\+> <\(.\+\)> \.$/\1/' \
| xargs -I % sh -c 'echo -n "%..." && curl -X DELETE % && echo -n "fcr:tombstone..." && curl -X DELETE %/fcr:tombstone && echo "done."'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment