Scripts to help with template email and upload.
[sitka/sitka-tools.git] / marc_export_custom / stats.sh
... / ...
CommitLineData
1#!/bin/bash
2files=$(ls *.marc.bz2 *.marc 2>/dev/null |grep -v split |sed 's,.bz2,,g')
3for i in $files; do
4 s=$i.stats
5 j=$i.bz2
6 [ -f $s ] && continue
7 echo === $i
8 if [ -f $j -a ! -f $i ]; then
9 bunzip2 -k $j
10 fi
11 if [ -f $i -a ! -f $j ]; then
12 pbzip2 -9kv -p4 $i
13 fi
14 if [ ! -f $i -o ! -f $j ]; then
15 echo "Missing $i or $j"
16 continue
17 fi
18 ls -la $i $j | tee $s
19 sha1sum $i $j | tee -a $s
20 marcdump --stats --quiet --noprint $i | tee -a ${s}
21 rm -f $i
22done