Hello all.
Allthough it probably isn't a tremendous memory saver, I couldn't 
accept that busybox tar didn't function due to the problem with the 
exclude files.
After a few changes to the /usr/sbin/lrcfg.back.script things are 
working.  I didn't find a problem with any of the packages I backed 
up. For root I had to create a special case. (because of the root list 
being (./ )
Tested with ash (from oxygen , linux 2.4.3 Busybox 0.50) 
Look very carefully for  changes in size at backing up !! 
Smaller packets are mostly not more compressed but less 
complete  ; ) 

Changes to lrcfg.back.script.
#!/bin/sh
#
#lrback.script v0.0.1 (don't trust these version numbers)
#
#Ropykite  Dave 'Kill a Cop' Cinege - GPL2
#
#Linux Router Project

if [ $# -ne 3 ]; then
        echo "Bad call to $(basename $0)"
        exit 1
fi

LRPKG="/var/lib/lrpkg"
MNT="$LRPKG/mnt"

PACKAGE="$1"
WTMP="$2"
CWRT="$3"
INCLUDE="/var/lib/lrpkg/$PACKAGE.list"
EXCLUDE="/tmp/EXCLUDE"
#
# included as a temporary file 
#
EXCLUDE2="/tmp/EXCLUDE2"
#
#
#

if [ "$WTMP" = "ON" ] ; then
        DIR="/tmp"
else
        DIR="$MNT"
fi


if [ "$CWRT" = "ON" ] && [ "$WTMP" = "OFF" ] ; then
        echo
        echo -n "Begin copy to device? (No space check!) "

        read YN
        if [ ! "$YN" = "y" ] ; then

                echo "Exiting..."
                sleep 2
                exit 1
        fi
fi

mv $INCLUDE /tmp/tmp.list >/dev/null 2>&1
#
# start of the real changes: 
#  cat  all include and exclude files except the one from
# PACKAGE to temp file EXCLUDE2 
#
cat /var/lib/lrpkg/*.list /var/lib/lrpkg/*.links >$EXCLUDE2
#
# now check for the include directory and files if any of the
# paths that are to exclude are a "deeper" description of the 
# include path if so than include the exclude path.
# ignore all paths that aren't in the include statement anyway.
#
for i in `cat /tmp/tmp.list `;
do
grep $i $EXCLUDE2 >> $EXCLUDE
done
#
#  for root use the "old" statement as "/" is not included 
# in the packages path. and all  paths are "deeper" as  
# the root path.
#
[ "$PACKAGE" = "root" ] && cat $EXCLUDE2 > $EXCLUDE
#
#  from here continue as usual except for tar 
#
mv /tmp/tmp.list $INCLUDE >/dev/null 2>&1

echo -n "Creating $PACKAGE.lrp Please wait: "

ticker

        cd /
        cd /
 #tar cf - -T $INCLUDE -X $EXCLUDE| gzip >$DIR/$PACKAGE.lrp
#ctar `cat $INCLUDE` -X `cat $EXCLUDE` | gzip \ 
>$DIR/$PACKAGE.lrp
#
#  now the actual tar statement
#
tar -c `cat $INCLUDE` -X $EXCLUDE | gzip >$DIR/$PACKAGE.lrp
#
#
killall ticker >/dev/null 2>&1
echo -n \^H

rm $EXCLUDE
rm $EXCLUDE2
#
# necessary to clean the two temp files
# the rest is as usuall 
if [ "$WTMP" = "ON" ]; then

        if [ "$CWRT" = "ON" ]; then
                echo
                echo "New Package:"
                ls -l /tmp/$PACKAGE.lrp
                echo "Old Package:"
               ls -l $MNT/$PACKAGE.lrp
                df $MNT
                echo
                echo -n "Enough freespace? (y/N) "

                read YN

                if [ ! "$YN" = "y" ]; then

                        echo "Exiting..."
                        rm /tmp/$PACKAGE.lrp
                        sync
                        sleep 2
                        exit 1
                fi
        fi

        echo -n "Copying $PACKAGE.lrp Please wait: "
        ticker

if ! cp /tmp/$PACKAGE.lrp $MNT/$PACKAGE.lrp >/dev/null 2>&1; 
then

echo "Could not move /tmp/$PACKAGE.lrp to \ 
$MNT/$PACKAGE.lrp"
               sleep 2
                exit 1
        fi

        killall ticker >/dev/null 2>&1
        echo -n \^H

        rm /tmp/$PACKAGE.lrp
fi

sync
exit 0

Any feedback is welcome 


eric Wolzak 
http://leaf.sourceforge.net/devel/ericw




_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to