Hi,

I was trying to check my v4 pool (no v3, no compression).
So I wrote a bash-skript which collects all "attrib_*"-files from pc/-directory and all files from pool/-directory.

After having collected it get every file from pool and searches for matching files in pc according to named (euqals md5sum). If not found it print these files.

Now I am wondering why I have loads of files existing in pool/ but not matching file in pc/. The setting is: *BackupPCNightlyPeriod = 1;* BackupPC_nightly was run and after it not backups have been scheduled. There are no "_" files in pool/.

When checking manually the printed files they indeed exist in pool/ but not in pc/.

I would expect the nightly job to remove the unneeded files- what am I missing?

Here's my script:
=================================
#!/bin/bash

PAR=no
if [ -f /usr/bin/parallel ]; then PAR=yes; fi
COUNT=no
if [ "$1" == "-c" ]; then COUNT=yes; fi

DIR="/var/lib/backuppc"
POOL="pool"
PC="pc"
WORKDIR="/dev/shm"
PID=$$

do_count()
{
        TASK=$1
        SPID=$2
        for i in $(cat pool-files.$SPID | grep -E "^$TASK.*$" ); do echo -n "$i "; grep -c "$i" pc-files.$SPID;done |grep " 0"  >> no_reference.$SPID
}

do_search()
{
        TASK=$1
        SPID=$2
        for i in $(cat pool-files.$SPID | grep -E "^$TASK.*$" ); do grep -q "$i" pc-files.$SPID || echo $i ;done >> no_reference.$SPID
}

export -f do_count
export -f do_search

cd $WORKDIR
rm -f pool-files* args.* pc-files* no_reference*
pushd $DIR/$PC
find . -type f -name "attrib_*" -printf "%f\n" | cut -d "_" -f 2 | sort | uniq  >  $WORKDIR/pc-files.$PID
popd
pushd $DIR/$POOL
find . -type f | grep -vE "^$" | cut -d "/" -f 4  > $WORKDIR/pool-files.$PID
popd
if [ "$PAR" == "yes" ]; then
        for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
                echo "$i" >> args.$PID
        done
        if [ "$COUNT" == "yes" ]; then
                cat args.$PID   | parallel do_count {} $PID
        else
                cat args.$PID   | parallel do_search {} $PID
        fi
        rm -f args.$PID
else
        for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
                if [ "$COUNT" == "yes" ]; then
                        do_count $i $PID
                else
                        do_search $i $PID
                fi
        done

fi
echo "# of file w/o reference: $(wc -l no_reference.$PID)"
exit

============================================================

Anyone having an idea?

Thanks a lot
/Christian
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to