X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=scripts%2Fpack-image.sh;h=4f9c8287c1dc009e8e269dbf77bd45ebcfc93cf0;hb=18ca258203f2ef6f669dbcdf687038947eab3791;hp=9a06f718bfb72a24ea7fbe691de98b40a36fa6bd;hpb=82560c4541eb3d2044bd9b4f359b713245fdac99;p=backups%2F.git diff --git a/scripts/pack-image.sh b/scripts/pack-image.sh index 9a06f71..4f9c828 100755 --- a/scripts/pack-image.sh +++ b/scripts/pack-image.sh @@ -57,13 +57,12 @@ echo "-> Running find to get the status of files" { for type in d f l; do findformat="$type %#m %u %g %s %CY%Cm%Cd%CH%CM%CS 0 %p\0" - if [ -z $excludeddirs ] + if [ -z $excludedirs ] then find $backupdirs -type $type -printf "$findformat" else - regex=`echo $excludedirs | sed -e 's/ /.*\\\\|/g'` - regex=`echo "'\($regex.*\)'"` - find $backupdirs -type $type -o -regex $regex -prune -o -printf "$findformat" + echo $excludedirs | sed -e 's/ /\n/g' > $tmpdir/excluded + find $backupdirs -type $type -printf "$findformat" | grep -z -v -f $tmpdir/excluded fi done } > $currentfiles @@ -81,11 +80,12 @@ cat $backups | rsync $rsyncopts / $isomountdir if [ $? != 0 ] then umount $isomountdir - rm -rf $isomountdir $isoimage + rm -rf $isomountdir $isoimage $backupdb.tmp err "Unable to rsync to pack the image" fi echo "-> Copying over database and status file" +mv $backupdb.tmp $backupdb cp $statusfile $backupdb $restorescript $isomountdir [ $? != 0 ] && err "Unable to copy the database and status file"