File: clsync-synchandler-rsyncshell.sh

package info (click to toggle)
clsync 0.4.5-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,404 kB
  • sloc: ansic: 15,074; sh: 466; makefile: 269
file content (28 lines) | stat: -rwxr-xr-x 416 bytes parent folder | download | duplicates (3)
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
#!/bin/sh -x

FROM="$PWD"
TO="$PWD/../to"

ACTION="$1"
LABEL="$2"
ARG0="$3"
ARG1="$4"

rsynclist() {
	LISTFILE="$1"
	EXCLISTFILE="$2"

	excludefrom=''
	if [ "$EXCLISTFILE" != "" ]; then
		excludefrom="--exclude-from=${EXCLISTFILE}"
	fi

	exec rsync -avH --delete-before "$excludefrom" --include-from="${LISTFILE}" --exclude='*' "$FROM"/ "$TO"/
}

case "$ACTION" in
	rsynclist)
		rsynclist "$ARG0" "$ARG1"
		;;
esac