Mercurial > hg > cc > cirrus_home
annotate bin/doExtract.sh @ 27:7a2bc060230d
first cut at doing extraction here
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 18 Mar 2020 15:23:53 +0000 |
parents | |
children | a95a1b31f5e9 |
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 |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
2 # Usage extract.sh ccid jobid segid |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
3 ccid=$1 |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
4 jobid=$2 |
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 |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
9 ls /beegfs/common-crawl/CC-MAIN-${ccid}/${segid}/CC-MAIN-*.warc.gz | \ |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
10 parallel -j 12 -N 1 '{ |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
11 id=$(echo {} | cut -f 6 -d / | cut -f 3- -d - | cut -f 1 -d .) |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
12 echo starting $id $(date) >> logs/${jobid}_{#}_log |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
13 unpigz -dp 1 -c {} | $HOME/lib/valhalla/bin/warc.sh ${id} application/pdf 2>> logs/${jobid}_{#}_log |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
14 echo finished ${id} $(date) >> logs/${jobid}_{#}_log |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
15 }' |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
16 echo $(date) $(hostname) $jobid $segid $? |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
17 tar -cf /beegfs/common-crawl/CC-MAIN-${ccid}/${segid}/extracts.tar * |
7a2bc060230d
first cut at doing extraction here
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
18 echo $(date) $(hostname) $jobid /beegfs/common-crawl/CC-MAIN-${ccid}/${segid}/extracts.tar |