/Designs/Measuring_instruments/RMDS01B/SW/Bolidozor/SpectrumLab/sync.sh
20,7 → 20,6
function info() {
echo -en "$BLUE"; echo -n $1; echo -e "$DEFAULT"
}
 
function error() {
echo -en "$RED"; echo -n $1; echo -e "$DEFAULT"
}
29,8 → 28,8
EXIT=1
i=1
# while [ $EXIT -ne 0 ]; do
info "Trying to sync $1, try number $i"
"$RSYNC" "$1"
info "Trying to sync $1, $2"
"$RSYNC" $1 $2
EXIT=$?
[ $EXIT -ne 0 ] && error "sync failed"
let i++
102,9 → 101,10
read LAST < "$1"/LAST
 
# sync last updated folders
syncdir ./audio/"$LAST"
syncdir ./capture/"$LAST"
syncdir ./data/"$LAST"
syncdir ./audio/"$LAST"
syncdir ./capture/"$LAST"
syncdir ./data/"$LAST"
syncdir ./data --delete
 
# days changed, sync yesterday too
[[ "$LAST" != "$OLD" ]] && info "syncing yesterday" && syncdir "$OLD"
/Designs/Measuring_instruments/RMDS01B/SW/Bolidozor/SpectrumLab/upload.sh
4,8 → 4,11
#
# this script should not be called manually
 
[[ "$#" -ne 1 ]] && echo "Please provide directory to upload" && exit 1
echo $1 , $2
echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
[[ "$#" < 1 ]] && echo "Please provide directory to upload" && exit 1
 
# debug
set -x
 
18,7 → 21,7
# could as well be changed for rsync -q, but this is more clear
if [[ -f exclude-list.txt ]]
then
rsync -avtz "$UPDIR"/ --rsh='ssh -p2223' --exclude-from='exclude-list.txt' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR"
rsync -avvtz "$2" "$UPDIR"/ --rsh='ssh -p2223' --exclude-from='exclude-list.txt' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR"
else
rsync -avtz "$UPDIR"/ --rsh='ssh -p2223' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR"
rsync -avvtz "$2" "$UPDIR"/ --rsh='ssh -p2223' meteor@meteor1.astrozor.cz:meteors/"$STATIONNAME"/"$UPDIR"
fi