This repository was archived by the owner on Feb 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyncdata.m
More file actions
40 lines (36 loc) · 1.36 KB
/
syncdata.m
File metadata and controls
40 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function rdir = syncdata(local,remote,varargin)
% SYNCDATA sychronizes files between the local and remote database
%__________________________________________________________________________
% SYNTAX:
% syncdata(local,remote);
% syncdata(local,remote,mes);
% syncdata(local,remote,mes,'on');
% syncdata(local,remote,'','on');
%
% DESCRIPTION:
%
%__________________________________________________________________________
% 1 - GATHER INPUT OPTIONS
mes = 'Synchronizing with latest available data, please wait...';
img = 'off';
if length(varargin) >= 1 && ~isempty(varargin{1});
mes = varargin{1};
end
if length(varargin) >= 2 && ischar(varargin{2});
img = varargin{2};
end
% 2 - BUILD WINSCP COMMAND
S{1} = '!winscp.exe /console /command ';
if strcmpi(img,'off');
S{2} = '"option exclude Images" ';
else
S{2} = '';
end
% ss = '!winscp.exe /command "option exclude Images" "open ftp://anonymous:ycweather@caesar.ce.montana.edu" "synchronize local C:\Users\pigpen\Documents\MSUResearch\MATLABcode\YCweather_v4\database\08-09 /pub/snow/db/08-09/" "exit"';
S{3} = '"open ftp://anonymous:ycweather@caesar.ce.montana.edu" ';
S{4} = ['"synchronize local ""',local,'"" ""',remote,'""" '];
S{5} = '"exit" ';
% 3 - EVALUATE COMMAND
disp(mes);
eval([S{:}]);
disp('Complete.');