1 |
9820
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
|
3 |
|
|
if false; then #### run script template:
|
4 |
|
|
#!/bin/bash -e
|
5 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/path/to/mysql.table.run
|
6 |
|
|
fi ####
|
7 |
|
|
|
8 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/table.run
|
9 |
|
|
|
10 |
|
|
if self_not_included; then
|
11 |
|
|
|
12 |
|
|
table.tsv.md5/make()
|
13 |
|
|
{
|
14 |
12779
|
aaronmk
|
begin_target; check_target_exists
|
15 |
9820
|
aaronmk
|
table_make "$target_filename"
|
16 |
|
|
}
|
17 |
|
|
|
18 |
|
|
table.tsv.gz/upload()
|
19 |
|
|
{
|
20 |
12779
|
aaronmk
|
begin_target
|
21 |
9820
|
aaronmk
|
live=1 sync_upload "$target"
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
table.tsv.gz/make()
|
25 |
|
|
{
|
26 |
12779
|
aaronmk
|
begin_target
|
27 |
9820
|
aaronmk
|
table_make "$target_filename"
|
28 |
|
|
if test ! "$test"; then table.tsv.gz/upload; fi
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
table.tsv/make() # usage: [remake=1] [limit=...] .../run table.tsv/make
|
32 |
|
|
{
|
33 |
12779
|
aaronmk
|
begin_target; check_target_exists
|
34 |
9820
|
aaronmk
|
(set_large_table; to_target mysql_export_local) || return
|
35 |
|
|
remake=1 bg_cmd "$target_filename".gz/make; sleep 6 # wait for log msgs
|
36 |
|
|
remake=1 "$target_filename".md5/make
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
export_mysql()
|
40 |
|
|
{
|
41 |
|
|
echo_func
|
42 |
|
|
table.tsv/make
|
43 |
|
|
}
|
44 |
|
|
|
45 |
9832
|
aaronmk
|
archive="$top_dir"/_archive/
|
46 |
|
|
|
47 |
|
|
archive_prev_versions()
|
48 |
|
|
{
|
49 |
12779
|
aaronmk
|
begin_target
|
50 |
9832
|
aaronmk
|
(mv_glob table.*.tsv "$top_dir"/_archive/)
|
51 |
|
|
}
|
52 |
|
|
|
53 |
9820
|
aaronmk
|
func_override import__table_run
|
54 |
|
|
import()
|
55 |
|
|
{
|
56 |
12779
|
aaronmk
|
begin_target
|
57 |
9820
|
aaronmk
|
export_mysql
|
58 |
9832
|
aaronmk
|
archive_prev_versions
|
59 |
9820
|
aaronmk
|
self_make import__table_run "$@"
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
fi
|