blob: a77d681cfa6fd1083c3f4b92f479ec49efd0ce5d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
##
# systr_rsync_normal <src> <dst> [<link>]
#
# Perform normal rsync operations to transfer files to or from the
# repository. If <link> is set, it is used as the --link-dest value
# for rsync. This function is polymorphic for both local and remote
# repositories.
##
function systr_rsync_normal
{
if [ $# -lt 2 ]; then
echo "Fatal: too few arguments to systr_rsync_normal"
exit 1
fi
src="$1"
dst="$2"
if [ $# -gt 2 ]; then
link="--link-dest=\"$3\""
else
link=""
fi
if [[ "$remote" == "" ]]; then
rsync -az --info=progress2 --info=stats2 \
--delete --exclude='*.systr' \
$link \
"$src" "$dst"
else
if [[ "$src" == "." ]]; then
dst="$remote:$dst"
else
src="$remote:$src"
fi
rsync -az -e ssh --info=progress2 --info=stats2 \
--delete --exclude='*.systr' \
$link \
"$src" "$dst"
fi
}
|