[Dovecot] Duplicated (but only for unread) messages after second rsync pass...
Reindl Harald
h.reindl at thelounge.net
Sun Dec 22 17:52:50 EET 2013
Am 22.12.2013 16:44, schrieb Charles Marcus:
> On 2013-12-22 10:37 AM, Timo Sirainen <tss at iki.fi> wrote:
>> Use rsync --delete to get rid of the extra mails in destination.
>
> I wondered if that would do it... thanks
in case of a 1:1 rsync you always want the parameters below
to include any sort of links, permissions and attributes
[harry at srv-rhsoft:~]$ which rsync.sh
/usr/local/bin/rsync.sh
[harry at srv-rhsoft:~]$ cat /usr/local/bin/rsync.sh
#!/bin/bash
# -z compress
# -t timestamps
# -P progress
# -r recursive
# -l links
# -H hard-links
# -p permissions
# -o owner
# -g group
# -E executability
# -A acls
# -X xtended attributes
# Sicherstellen dass Source UND Target uebergeben wurden
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$1" == "$2" ]; then
echo "USAGE: rsync.sh <source> <target> [bwlimit]"
exit
fi
# Standard-Parameter
RSYNC_PARAMS="--no-motd --force --delete-after --devices --specials --sparse -tPrlHpogEAX"
# Wenn in einem der beiden Paramneter ein @ vorkommt Komprimierung einschalten
# Ansonsten handelt es sich um zwei lokale Ordner und rsync wuerde die
# Daten ohne Sinn komprimieren
if [ `grep '@' <<< "$1"` ] || [ `grep '@' <<< "$2"` ]; then
RSYNC_PARAMS="--compress --sockopts=SO_SNDBUF=32768,SO_RCVBUF=32768 $RSYNC_PARAMS"
fi
if [ "$3" != "" ]; then
RSYNC_PARAMS="--bwlimit=$3 $RSYNC_PARAMS"
fi
# Eigentliches Kommando ausfuehren
nice -n 19 rsync $RSYNC_PARAMS --rsync-path='nice -n 19 rsync' "$1" "$2"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20131222/e634201c/attachment.bin>
More information about the dovecot
mailing list