using namespace std;
static const unsigned int bytes_in_block = 0x800;
-static const char * dbname = "/var/lib/backups/backups.db";
+static const char * dbname = "/var/lib/backups/backups.db.tmp";
unsigned long long read_time( istream &i ) {
string date_string;
{
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
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"