Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Created July 17, 2013 14:25
Show Gist options
  • Save joyrexus/0d305d2da1102e45defe to your computer and use it in GitHub Desktop.
Save joyrexus/0d305d2da1102e45defe to your computer and use it in GitHub Desktop.
#ldp | Shell script to download and build the LDP dataset (sqlite database).
#!/usr/sh
DB="ldp.db"
SERVER="joyrexus.spc.uchicago.edu"
URL="http://$SERVER/LDP/data/db/latest/ldp.sql.gz"
if [ -e $DB ]
then
mv -f $DB $DB.bk
fi
echo "starting build of $DB"
echo "... retrieving data from $SERVER"
echo "... this may take a few minutes"
curl $URL | gunzip -c | sqlite3 $DB
if [ -e $DB ]
then
echo "$DB built!"
else
echo "sorry, build of $DB failed"
echo "check your network connection"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment