Mercurial > hg > cc > cirrus_home
annotate bin/doExtract.sh @ 33:4c23b1766692
towards sub-division of resulting tar files
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Tue, 24 Mar 2020 17:53:35 +0000 |
parents | 1e479e3ea9c4 |
children | ec99b2d1d2fc |
rev | line source |
---|---|
27
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
1 #!/bin/bash |
29
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
2 # Usage doExtract.sh ccid jobid segid |
27
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
3 ccid=$1 |
29
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
4 export jobid=$2 |
27
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
5 segid=$3 |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
6 echo $(date) $(hostname) $jobid $segid |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
7 mkdir -p $segid/logs |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
8 cd $segid |
29
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
9 ls /beegfs/common_crawl/CC-MAIN-${ccid}/${segid}/CC-MAIN-*.warc.gz | \ |
33
4c23b1766692
towards sub-division of resulting tar files
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
30
diff
changeset
|
10 parallel --joblog job_${jobid}.log -j 18 -N 1 'id=$(echo {} | cut -f 6 -d / | cut -f 3- -d - | cut -f 1 -d .) ; \ |
30 | 11 echo starting $id $(date) >> logs/${jobid}_{#}_log ; \ |
12 unpigz -dp 1 -c {} | $HOME/lib/valhalla/bin/warc.sh ${id} application/pdf 2>> logs/${jobid}_{#}_log ; \ | |
13 echo finished ${id} $(date) >> logs/${jobid}_{#}_log' | |
29
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
14 res=$? |
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
15 echo $(date) $(hostname) $jobid $segid $res |
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
16 if [ $res = 0 ] |
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
17 then |
33
4c23b1766692
towards sub-division of resulting tar files
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
30
diff
changeset
|
18 cat ../by11s.txt | while read |
4c23b1766692
towards sub-division of resulting tar files
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
30
diff
changeset
|
19 tar -cf /beegfs/common_crawl/CC-MAIN-${ccid}/${segid}/extracts.tar * && |
29
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
20 echo $(date) $(hostname) $jobid /beegfs/common_crawl/CC-MAIN-${ccid}/${segid}/extracts.tar |
a95a1b31f5e9
try to fix multi-line lossage
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
27
diff
changeset
|
21 fi |