annotate bin/psplitTars.sh @ 56:c0c030e8b219

too big for /dev/shm, split in half
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 14 Apr 2020 17:52:34 +0100
parents 50556ac15e88
children 849ccd30258d
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 | \
56
c0c030e8b219 too big for /dev/shm, split in half
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 55
diff changeset
3 parallel --will-cite -j 4 -n 1 '
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
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}
56
c0c030e8b219 too big for /dev/shm, split in half
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 55
diff changeset
10 tar -x --skip-old-files -f ${h}/${segid}/extracts.tar
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
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
56
c0c030e8b219 too big for /dev/shm, split in half
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 55
diff changeset
18 rm -rf /dev/shm/rex/${segid}/*
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
19 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
20 '