lib/functions.sh: Tweak rsync options somewhat.
[mirror-admin] / lib / functions.sh
CommitLineData
db2c5b8b
MW
1### -*-sh-*-
2###
3### Common functions for mirror scripts.
4
5rsync_timeout=60
6
7standard_rsync () {
8 for i in 1 2 3 4 5; do
9 set +e
10 rsync --recursive \
11 --verbose \
12 --timeout=$rsync_timeout \
13 --times --omit-dir-times \
14 --links --safe-links \
15e71a97 15 --delete-delay --delete-excluded --delay-updates \
db2c5b8b
MW
16 --chmod=ug=rw,o=r,Dg+s,Da+x --perms \
17 "$@"
18 rc=$?
19 set -e
20 case $rc in
21 30) ;;
22 *) return $rc ;;
23 esac
24 echo >&2 "rsync connection timed out: retrying"
25 done
26 return 30
27}