annotate bin/psplitTars.sh @ 55:50556ac15e88

one-off to convert big extracts.tar into lots of smaller ones
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 14 Apr 2020 16:10:22 +0100
parents
children c0c030e8b219
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 #!/usr/bin/bash
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 cat /beegfs/common_crawl/CC-MAIN-2019-35/bigtar.txt | \
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 parallel --will-cite -j 8 -n 1 '
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 segid={}
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5 echo $segid starting
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 ccid=2019-35
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 h=/beegfs/common_crawl/CC-MAIN-${ccid}
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8 mkdir -p /dev/shm/rex/${segid}
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 cd /dev/shm/rex/${segid}
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 tar -xf ${h}/${segid}/extracts.tar
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 pfx=$(ls ${h}/${segid}/CC-MAIN-*-00000.warc.gz |\
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 cut -f 6 -d / | cut -f 3,4 -d -)
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13 cat ../by11s.txt | while read i j
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 do ((n=i/11))
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15 tar -cf /beegfs/common_crawl/CC-MAIN-${ccid}/${segid}/extract_${n}.tar \
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16 $(seq $i $j | xargs -I ^ bash -c "{ k=^; printf \"\${0}-%05.0f_* logs/*_%03.0f_log\n\" \$k \$k ; }" $pfx)
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17 done
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 echo $(date) $segid done
50556ac15e88 one-off to convert big extracts.tar into lots of smaller ones
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19 '