Mercurial > hg > cc > cirrus_work
annotate bin/do_idx.sh @ 133:3682ef4d2169
get 7f (two cases) and %25 working
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Thu, 28 Sep 2023 18:31:23 +0100 |
parents | 5b952d16838c |
children | 0326805aa6df |
rev | line source |
---|---|
101
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
1 #!/bin/bash |
110
a0ea1e4a714d
pass in debug flag(s) to merge_date.py
Henry Thompson <ht@markup.co.uk>
parents:
105
diff
changeset
|
2 while [ "$1" = "-d" ] |
a0ea1e4a714d
pass in debug flag(s) to merge_date.py
Henry Thompson <ht@markup.co.uk>
parents:
105
diff
changeset
|
3 do |
a0ea1e4a714d
pass in debug flag(s) to merge_date.py
Henry Thompson <ht@markup.co.uk>
parents:
105
diff
changeset
|
4 shift |
a0ea1e4a714d
pass in debug flag(s) to merge_date.py
Henry Thompson <ht@markup.co.uk>
parents:
105
diff
changeset
|
5 debug="$debug -d" |
a0ea1e4a714d
pass in debug flag(s) to merge_date.py
Henry Thompson <ht@markup.co.uk>
parents:
105
diff
changeset
|
6 done |
101
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
7 export res="$1" |
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
8 orig="$2" |
105
9403c02d5034
switch to gzip -7 to get comparable compressed cdx block size
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
103
diff
changeset
|
9 # igzip was faster, but produced bigger files, so went to gzip one step |
9403c02d5034
switch to gzip -7 to get comparable compressed cdx block size
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
103
diff
changeset
|
10 # smaller than default (-6), which produces slightly _smaller_ blocks. |
116 | 11 merge_date.py $debug <(LC_ALL=C sort -m -k1,3 -s $res/ks_[0-9]*.tsv) \ |
12 $orig $res/idx 2>$res/merge.log | \ | |
101
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
13 parallel -j 10 'echo {#} {} >$res/merge_{#}.log |
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
14 echo $(date) {#} {} |
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
15 export res |
105
9403c02d5034
switch to gzip -7 to get comparable compressed cdx block size
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
103
diff
changeset
|
16 split -l 3000 --filter="gzip -c -7 --keep | \ |
101
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
17 tee >(wc -c >> \ |
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
18 $res/merge_{#}.log)" \ |
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
19 {} > {}.gz && \ |
e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
20 rm {}' |