clsync-synchandler-rsyncshell.sh 416 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh -x
  2. FROM="$PWD"
  3. TO="$PWD/../to"
  4. ACTION="$1"
  5. LABEL="$2"
  6. ARG0="$3"
  7. ARG1="$4"
  8. rsynclist() {
  9. LISTFILE="$1"
  10. EXCLISTFILE="$2"
  11. excludefrom=''
  12. if [ "$EXCLISTFILE" != "" ]; then
  13. excludefrom="--exclude-from=${EXCLISTFILE}"
  14. fi
  15. exec rsync -avH --delete-before "$excludefrom" --include-from="${LISTFILE}" --exclude='*' "$FROM"/ "$TO"/
  16. }
  17. case "$ACTION" in
  18. rsynclist)
  19. rsynclist "$ARG0" "$ARG1"
  20. ;;
  21. esac