Am 22.12.2013 16:44, schrieb Charles Marcus:
On 2013-12-22 10:37 AM, Timo Sirainen <tss@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@srv-rhsoft:~]$ which rsync.sh /usr/local/bin/rsync.sh
[harry@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"