Project

General

Profile

« Previous | Next » 

Revision 8224

inputs/GBIF/: Added scripts for subsetting refresh

View differences:

inputs/GBIF/_MySQL/MySQL_schema
1
#!/bin/sh
2
set -o errexit
3

  
4
alias sed="sed -`case "$(uname)" in Darwin) echo E;; *) echo r;; esac`"
5

  
6
set -x
7
exec sed -n '/^-- Table structure for table `.*`$/'\
8
',/^\/\*!40101 SET character_set_client = @saved_cs_client \*\/;$/{p}'
0 9

  
inputs/GBIF/_MySQL/import
1
#!/bin/bash
2
set -o errexit
3
cd "$(dirname "$0")"
4

  
5
make
0 6

  
inputs/GBIF/_MySQL/Makefile
1
include ../../../lib/common.Makefile
2

  
3

  
4
types := schema data
5

  
6
all: $(types:%=GBIFPortalDB-2013-02-20.%.sql) ;
7

  
8
%.schema.sql: ../_src/%.dump
9
	./MySQL_schema <$< >$@
10

  
11
%.data.sql: ../_src/%.dump
12
	./MySQL_data data_provider data_provider_agent data_resource \
13
data_resource_agent raw_occurrence_record <$< >$@
inputs/GBIF/_MySQL/MySQL_data
1
#!/bin/bash
2
set -o errexit
3

  
4
alias sed="sed -`case "$(uname)" in Darwin) echo E;; *) echo r;; esac`"
5

  
6
test "$#" -ge 1 || set -- '.*' # include all tables
7

  
8
opts=()
9
for table in "$@"; do
10
	opts=("${opts[@]}" -e '/^-- Dumping data for table `'"$table"'`$/'\
11
',/^UNLOCK TABLES;$/{p}')
12
done
13

  
14
set -x
15
exec sed -n "${opts[@]}"
0 16

  
inputs/GBIF/import
1
#!/bin/sh
2
set -o errexit
3
cd "$(dirname "$0")"
4

  
5
./_MySQL/import
0 6

  

Also available in: Unified diff