new stat tool.
[sitka/sitka-tools.git] / marc_export_custom / stats.sh
CommitLineData
8ec81273 1#!/bin/bash
7716c3a7
RJ
2basedir=$(dirname $0)
3files=$(ls *.marc.bz2 *.marc 2>/dev/null |grep -v split |sed 's,\.bz2,,g' | sort | uniq)
8ec81273
RJ
4for i in $files; do
5 s=$i.stats
6 j=$i.bz2
7 [ -f $s ] && continue
8 echo === $i
9 if [ -f $j -a ! -f $i ]; then
10 bunzip2 -k $j
11 fi
12 if [ -f $i -a ! -f $j ]; then
13 pbzip2 -9kv -p4 $i
14 fi
15 if [ ! -f $i -o ! -f $j ]; then
16 echo "Missing $i or $j"
17 continue
18 fi
7716c3a7
RJ
19 echo -n '' >$s
20 $basedir/stats-distribution.pl $i | tee $s-holding-distribution.csv
21 ls -la $i $j | tee -a $s
8ec81273
RJ
22 sha1sum $i $j | tee -a $s
23 marcdump --stats --quiet --noprint $i | tee -a ${s}
24 rm -f $i
25done