Line 2... |
Line 2... |
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 |
echo $1 , $2 |
7 |
echo "$1 ; $2 ; $3" |
8 |
echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
8 |
echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
9 |
|
9 |
|
10 |
[[ "$#" < 1 ]] && echo "Please provide directory to upload" && exit 1 |
10 |
[[ "$#" < 1 ]] && echo "Please provide directory to upload" && exit 1 |
11 |
|
11 |
|
12 |
# debug |
12 |
# debug |
Line 19... |
Line 19... |
19 |
|
19 |
|
20 |
# if exclude-list.txt is present, use it |
20 |
# if exclude-list.txt is present, use it |
21 |
# could as well be changed for rsync -q, but this is more clear |
21 |
# could as well be changed for rsync -q, but this is more clear |
22 |
if [[ -f exclude-list.txt ]] |
22 |
if [[ -f exclude-list.txt ]] |
23 |
then |
23 |
then |
24 |
rsync -avvtz "$2" "$UPDIR"/ --rsh='ssh -p2223' --exclude-from='exclude-list.txt' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR" |
24 |
rsync -vvtz $2 $3 "$UPDIR"/ --rsh='ssh -p2223' --exclude-from='exclude-list.txt' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR" |
25 |
else |
25 |
else |
26 |
rsync -avvtz "$2" "$UPDIR"/ --rsh='ssh -p2223' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR" |
26 |
rsync -vvtz $2 $3 "$UPDIR"/ --rsh='ssh -p2223' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR" |
27 |
fi |
27 |
fi |