Created
November 14, 2019 08:07
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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