view bin/doPlinks.sh @ 188:0c5422df3a67

runs, but no cdx yet, because no value.content I presume
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Mon, 23 Sep 2024 19:18:36 +0100
parents b0d9fe66ce8a
children
line wrap: on
line source

#!/usr/bin/bash
hn=$1
jn=$2
tfn=$3

mkdir -p /dev/shm/x$hn/${tfn}
cd /dev/shm/x$hn/${tfn}
tar -xf /beegfs/common_crawl/CC-MAIN-2019-35/pdfs/${tfn}.tar '*.pdf'
echo $(date) $hn $(pwd) untarred ${tfn}.tar for job $jn 1>&2
ls *.pdf | sort --field-separator=_ -k1,1 -k2n,2 | cat -n |\
$HOME/bin/plinks.py $tfn || { echo $(date) $hn aborted job $jn for $tfn \[remember to clean up\] ; rm -f /dev/shm/x$hn/${tfn}/stopJob ; exit 1 ; }
echo $(date) $hn tarring $(ls badpdfs_*|wc -l)/$(ls links_*_*|wc -l) results from job $jn for $tfn in $(pwd) 1>&2
tar -cf /beegfs/common_crawl/CC-MAIN-2019-35/pdfs/links/${tfn}.tar badpdfs_${tfn} links_${tfn}_*
echo $(date) $(pwd) rm $(ls -lt badpdfs_*) 1>&2
rm *
cd ..
echo $(date) $(pwd) rmdir ${tfn} 1>&2
rmdir ${tfn}
echo $(date) $hn finished job ${jn} for ${tfn}