/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"