outDir = 'SeaHorseFiles';

ndays = 8;
profperday = 24;

files = dir([outDir '/*.hex']);
last = files(end).date;
clear files;
hours_back = ceil(24*(now-datenum(last)))
if(hours_back == 0)
    hours_back = ndays*24;
end

hours_back = 6;

%hours_back = 96;

cmd = ['!perl getSeaHorse.pl ' num2str(hours_back)];  %Just get the files since the last uploads.
eval(cmd)

%Convert .HEX files to .cnv files (makefile in outDir does that).
cmd = ['cd ',outDir]
eval(cmd);
cmd = ['!make']
eval(cmd)
cmd = ['cd ..']
eval(cmd);

clear all
close all