Project

General

Profile

1 11436 aaronmk
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/import.run "$@"
3 14534 aaronmk
.rel ../sh/archives.sh
4 11436 aaronmk
.rel ../sh/local.sh
5
6
if self_not_included; then
7
8 11461 aaronmk
export extract_view="${top_filename%.csv}"
9
10 14534 aaronmk
prep_export()
11 11436 aaronmk
{
12 13821 aaronmk
	umask ug=rwx,o= # prevent files from becoming web-accessible
13 14534 aaronmk
}
14
15
export_only()
16
{
17
	begin_target; deferred_check_target_exists; prep_export
18 11461 aaronmk
	table="$extract_view" to_top_file pg_export
19 11436 aaronmk
}
20
21 14534 aaronmk
compress_()
22
{
23
	begin_target; deferred_check_target_exists; prep_export
24
	full_file="$top_file" compress
25
}
26 11574 aaronmk
27 14534 aaronmk
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 11436 aaronmk
fi