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