#!/bin/bash

# This is a simple shell script to sync selected realtime logs over to the 
# HotSpot outgoing directory during testing. BK had some trouble getting cron 
# working through BusyBox on the vehicles, so we will come back to that in the 
# future.

while true; do 
#rsync -a -f"+ */" -f"+ slate[0-9]*" -f"+ slate.d*" -f"- *" /mnt/mmc/LRAUV/Logs/ /opt/hotspot/outgoing/beach/

# Send all directories (except Config) that contain Normal.bak
#rsync -a -f"- Config/" -f"+ */" -f"+ Normal*.bak" -f"- *" /mnt/mmc/LRAUV/Logs/ /opt/hotspot/outgoing/beach/

# Send just Normal.bak and any directories that contain files matching the filter
nice -n 19 rsync -a -f"- Config/" -f"- *.parts" -f"+ */" -f"+ Normal*.bak" /mnt/mmc/LRAUV/Logs/ /opt/hotspot/outgoing/ship-hotspot/
sleep 300
done


