Rev 3237 Rev 3434
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 # 2 #
3 # sync directory to server 3 # sync directory to server
4 # 4 #
5 # this script should not be called manually 5 # this script should not be called manually
6   6  
7 [[ "$#" -ne 1 ]] && echo "Please provide directory to upload" && exit 1 7 [[ "$#" -ne 1 ]] && echo "Please provide directory to upload" && exit 1
8   8  
9 # debug 9 # debug
10 set -x 10 set -x
11   11  
12 #cd `dirname $1` 12 #cd `dirname $1`
13 #UPDIR=`basename $1` 13 #UPDIR=`basename $1`
14 UPDIR="$1" 14 UPDIR="$1"
15   15  
16 # if exclude-list.txt is present, use it 16 # if exclude-list.txt is present, use it
17 # could as well be changed for rsync -q, but this is more clear 17 # could as well be changed for rsync -q, but this is more clear
18 if [[ -f exclude-list.txt ]] 18 if [[ -f exclude-list.txt ]]
19 then 19 then
20 rsync -avtz "$UPDIR"/ --exclude-from='exclude-list.txt' meteor@neptun.avc-cvut.cz:data/"$UPDIR" 20 rsync -avtz "$UPDIR"/ --exclude-from='exclude-list.txt' meteor@neptun.avc-cvut.cz:data/"$UPDIR"
21 else 21 else
22 rsync -avtz "$UPDIR"/ meteor@neptun.avc-cvut.cz:data/"$UPDIR" 22 rsync -avtz "$UPDIR"/ meteor@neptun.avc-cvut.cz:data/"$UPDIR"
23 fi 23 fi
-   24  
-   25 xxx