#!/bin/bash

DIR=/root/Paranoidbackup/all
CONTROL=control
S=/root/Paranoidbackup/verify_control_lists

if test "$1" != "--part2"; then

cd $DIR

for A
in $CONTROL*[0-9]
do echo doing file $A
   $S --part2 < $A
done

for A
in $CONTROL*[0-9].gz
do echo doing file $A
   gzip  --decompress --stdout $A | $S --part2
done

exit
fi


cd /

while read REPLY
do if ! test -e "$REPLY"
   then if ! test -L "$REPLY"
        then echo $REPLY does not exist
        fi
   fi
done

exit

This script checks every file listed in the control lists to make sure that
file actually exists. In theory, it should not find any files which do not
exist; so if it does, then something may be wrong. If it finds files which
were deleted after the last backup, that is ok, pb should remove them from
the control lists next backup; you would not have to worry about this if you
run this script immediately after a backup. If it finds files which you
backed up, then excluded, then deleted; that is something pb cannot deal
with; you must manually remove those files from the control lists.

if we have a symbolic link to a file which does not exist, test -e will say
it does not exist, even though the link does exist. Thus we do test -L after
test -e fails.

if we have a file which has spaces in the file name, test becomes confused;
that is why quotes are used in   test -e "$REPLY"   and   test -L "$REPLY"
