#!/usr/bin/env bash## sync directory to server## this script should not be called manuallyecho xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[[ "$#" < 1 ]] && echo "Please provide directory to upload" && exit 1# debugset -x#cd `dirname $1`#UPDIR=`basename $1`UPDIR="$1"STATIONNAME=${PWD##*/}# if exclude-list.txt is present, use it# could as well be changed for rsync -q, but this is more clearif [[ -f exclude-list.txt ]]thenrsync -vvtz $2 $3 "$UPDIR"/ --rsh='ssh -p2223' --exclude-from='exclude-list.txt' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR"elsersync -vvtz $2 $3 "$UPDIR"/ --rsh='ssh -p2223' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR"fi