1
|
#!/bin/bash -e
|
2
|
. "$(dirname "${BASH_SOURCE[0]}")"/import.run "$@"
|
3
|
.rel ../sh/archives.sh
|
4
|
.rel ../sh/local.sh
|
5
|
|
6
|
if self_not_included; then
|
7
|
|
8
|
export extract_view="${top_filename%.csv}"
|
9
|
|
10
|
prep_export()
|
11
|
{
|
12
|
umask ug=rwx,o= # prevent files from becoming web-accessible
|
13
|
}
|
14
|
|
15
|
export_only()
|
16
|
{
|
17
|
begin_target; deferred_check_target_exists; prep_export
|
18
|
table="$extract_view" to_top_file pg_export
|
19
|
}
|
20
|
|
21
|
compress_()
|
22
|
{
|
23
|
begin_target; deferred_check_target_exists; prep_export
|
24
|
full_file="$top_file" compress
|
25
|
}
|
26
|
|
27
|
export_()
|
28
|
{
|
29
|
begin_target
|
30
|
with_rm export_only
|
31
|
with_rm compress_
|
32
|
}
|
33
|
|
34
|
export_sample() { begin_target; n=100 with_rm export_only; }
|
35
|
|
36
|
fi
|