- local dir="$srcdir/$letter/$user"
- [ -d $dir ] || fatal "maildir $dir not found".
-
-# while true; do
-# load=`uptime | sed 's/^.*load average: \\([^,]*\\).*$/\\1/'`
-# over=`expr $load \> $loadlimit`
-# if [ $over == 1 ]; then
-# info "load $load, sleeping..."
-# sleep 600
-# else
-# break
-# fi
-# done
-
- cmd="$RSYNC $rsyncflags $excludes $dir $destuser@$desthost:$destdir/$letter"
- ret=`rsync -e "ssh -p $destport" -r \
---links --ignore-existing --delete --size-only --bwlimit=$speedlimit \
---exclude '.Trash/*' --exclude '.Mistakes/*' --exclude '.Spam/*' \
-$dir $destuser@$desthost:$destdir/$letter \
-2>&1`
+ local source="$srcdir/$letter/$user/"
+ local target="$destdir/$letter/$user/$btype.1"
+ [ -d $source ] || fatal "maildir $source not found".
+
+ debug "syncing"
+ ret=`$RSYNC -e "ssh -p $destport" -r \
+ --links --ignore-existing --delete --size-only --bwlimit=$speedlimit \
+ --exclude '.Trash/*' --exclude '.Mistakes/*' --exclude '.Spam/*' \
+ $source $destuser@$desthost:$target \
+ 2>&1`