#!/bin/sh
# Build pdbase File Lists And Tables Of Contents
PDBROOT=/pdbase
PDBASE=$PDBROOT/pub/000-Allfiles.txt
NEWFILES=$PDBROOT/pub/000-Newfiles.txt
UNZIP='/usr/local/bin/unzip -z'
UNIXTOOLS=/usr/bin
FMTPDB=$PDBROOT/bin/fmtpdb.awk
# Build the master file list
#/usr/home/tundra/.local/bin/pew in python2 $PDBROOT/bin/bldpdb.py | $UNIXTOOLS/sort >$PDBASE
$PDBROOT/bin/bldpdb.py | $UNIXTOOLS/sort >$PDBASE
#$UNIXTOOLS/find $PDBROOT/pub -name \*.zip -exec $UNZIP {} 2>/dev/null \;\
#| $UNIXTOOLS/awk -f $FMTPDB | $UNIXTOOLS/sort > $PDBASE
# Build the list of new files
$UNIXTOOLS/find $PDBROOT/pub -name \*.zip -mtime -30 -exec $UNZIP {} 2>/dev/null \; \
| $UNIXTOOLS/awk -f $FMTPDB | $UNIXTOOLS/sort > $NEWFILES
# Create A Table Of Contents For Each Directory
$PDBROOT/bin/bldtoc