rsync="rsync -azR --delete --bwlimit=$bandwidth"
ob=""
+lpb=""
for pb in $backupdir/[0-9]*; do
bdd=`basename $pb`
if [ ! -f $backupdir/.$bdd ]; then
rm -rf $cbd
mv $pb $cbd
log continuing $pb as $cbd ...
- fi
-
- # if this is a new day backup, i.e.:
- # - this is somewhere else!!!
- # try to use content as basis
- # ...
-
- rsrc=""
- for dir in $homedirs; do
- rsrc="$rsrc :/home/$user/$dir"
- done
- rsrc="`echo $rsrc | sed 's/^\ //'`"
- for dir in $extradirs; do
- rsrc="$rsrc :$dir"
- done
- [ ! -z "$homedirs" ] && \
- log backing up home directories $homedirs ...
- [ ! -z "$extradirs" ] && \
- log backing up directories $extradirs ...
- $rsync $user@$remote$rsrc $cbd
- ret=$?
- if [ "$ret" != "0" ]; then
- log backup terminated before completion ...
- exit -50
- fi
-
- touch $backupdir/.`basename $cbd`
- log "backup `basename $cbd` completed :)"
- else
- if [ "$pb" = "$cbd" ]; then
- log backup $bdd found completed ...
+ else
+ if [ ! -z "$lpb" ]; then
+ rm -rf $cbd
+ mv $lpb $cbd
+ log "starting backup $today from $lpb ..."
+ else
+ log starting backup from scratch ...
+ fi
fi
fi
+ lpb=$pb
ob="$ob $pb"
done
+if [ ! -f $backupdir/.$today ]; then
+ rsrc=""
+ for dir in $homedirs; do
+ rsrc="$rsrc :/home/$user/$dir"
+ done
+ rsrc="`echo $rsrc | sed 's/^\ //'`"
+ for dir in $extradirs; do
+ rsrc="$rsrc :$dir"
+ done
+ [ ! -z "$homedirs" ] && \
+ log backing up home directories $homedirs ...
+ [ ! -z "$extradirs" ] && \
+ log backing up directories $extradirs ...
+ $rsync $user@$remote$rsrc $cbd
+ ret=$?
+ if [ "$ret" != "0" ]; then
+ log backup terminated before completion ...
+ exit -50
+ fi
+
+ touch $backupdir/.$today
+ log "backup $today completed :)"
+else
+ log backup $bdd found completed ...
+fi
+
cob=`echo $ob | wc -w`
if [ $cob -gt $replicas ]; then
((numdel=cob-replicas))