Mercurial > hg > cc > cirrus_home
comparison bin/preExtract.sh @ 51:427056f1784e
a few tweaks after 2nd parallel run
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sat, 11 Apr 2020 13:41:46 +0100 |
parents | 5de261eb0deb |
children | 9cd9daf75183 |
comparison
equal
deleted
inserted
replaced
50:5de261eb0deb | 51:427056f1784e |
---|---|
34 cut -f 2,3 in.txt| sort -u | tr '\011' '\012' |\ | 34 cut -f 2,3 in.txt| sort -u | tr '\011' '\012' |\ |
35 parallel --will-cite -j 16 -N 2 h="$h"' | 35 parallel --will-cite -j 16 -N 2 h="$h"' |
36 function sus () { sort "$@" | uniq -c | sort -k1nr,1 ; } | 36 function sus () { sort "$@" | uniq -c | sort -k1nr,1 ; } |
37 s={1} | 37 s={1} |
38 p={2} | 38 p={2} |
39 mkdir -p $s/logs | 39 mkdir -p /dev/shm/rex/$s/logs |
40 cd $s | 40 cd /dev/shm/rex/$s |
41 echo $(date) starting $s/$p > log | 41 echo $(date) starting $s/$p > log |
42 # Sigh, should not have used this in the extraction ... | 42 # Sigh, should not have used this in the extraction ... |
43 jobid=$(tar -tf ${h}/${s}/extract_0.tar logs/ | head -1 | \ | 43 jobid=$(tar -tf ${h}/${s}/extract_0.tar logs/ | head -1 | \ |
44 cut -f 2 -d / |cut -f 1 -d _) | 44 cut -f 2 -d / |cut -f 1 -d _) |
45 for e in $(egrep "\b$s\b" ../in.txt |cut -f 1 | sort -u) | 45 for e in $(egrep "\b$s\b" ../in.txt |cut -f 1 | sort -u) |
88 ^" "[0-9]*" > 1 < 1 --- 1 "[0-9]*c[0-9]*" 1 "[0-9]*"a"[0-9,]*" "$ ]] | 88 ^" "[0-9]*" > 1 < 1 --- 1 "[0-9]*c[0-9]*" 1 "[0-9]*"a"[0-9,]*" "$ ]] |
89 then | 89 then |
90 : | 90 : |
91 else | 91 else |
92 echo " " "extra lines in ${e}_check.txt" >> log | 92 echo " " "extra lines in ${e}_check.txt" >> log |
93 cd .. | |
94 continue | 93 continue |
95 fi | 94 fi |
96 elif [ $(fgrep -c a ${e}_check.txt) -ne $ni ] | 95 elif [ $(fgrep -c a ${e}_check.txt) -ne $ni ] |
97 then | 96 then |
98 echo " " "non-addition lines in ${e}_check.txt" >> log | 97 echo " " "non-addition lines in ${e}_check.txt" >> log |
99 cd .. | |
100 continue | 98 continue |
101 fi | 99 fi |
102 echo " " starting tar update >> log | 100 echo " " starting tar update >> log |
103 egrep "^> " ${e}_diff.txt | cut -f 2 > ${e}_new.txt | 101 egrep "^> " ${e}_diff.txt | cut -f 2 > ${e}_new.txt |
104 tar --delete -f ${h}/${s}/extract_${e}.tar "${lff[@]}" | 102 tar --delete -f ${h}/${s}/extract_${e}.tar "${lff[@]}" |
105 tar --append -f ${h}/${s}/extract_${e}.tar --files-from=${e}_new.txt "${lff[@]}" | 103 tar --append -f ${h}/${s}/extract_${e}.tar --files-from=${e}_new.txt "${lff[@]}" |
106 else | 104 else |
107 echo "no diff, no update" $e >> log | 105 echo "no diff, no update" $e >> log |
108 fi | 106 fi |
109 echo end extract: $e >> log | 107 echo end extract: $e >> log |
110 done | |
111 cd .. | |
112 ' | 108 ' |