Skip to content

Instantly share code, notes, and snippets.

@helix84
Created November 14, 2019 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helix84/4f11cc5fc90c5f771cd5fd5e423ff4b7 to your computer and use it in GitHub Desktop.
Save helix84/4f11cc5fc90c5f771cd5fd5e423ff4b7 to your computer and use it in GitHub Desktop.
DSpace: create a mock assetstore with empty files with names from the database
#!/bin/sh
DBNAME=dspace5
psql $DBNAME -A -t -c "SELECT internal_id FROM bitstream" > /tmp/ids.txt
for id in `cat /tmp/ids.txt`; do
dir=`echo $id | cut -c1-2`/`echo $id | cut -c3-4`/`echo $id | cut -c5-6`
echo $dir/$id
mkdir -p assetstore/$dir
touch assetstore/$dir/$id
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment