forked from torbenott/BpodFunctions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserKillScriptCopy.m
More file actions
30 lines (27 loc) · 1.52 KB
/
UserKillScriptCopy.m
File metadata and controls
30 lines (27 loc) · 1.52 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
%User Kill Script
%this script, when saved in the current protocol folder, will be executed
%at Bpod termination.
%Serves for custom and protocol specific action at session end.
%% PUT USER-SPECIFIC STUFF HERE%%
% For example, save behavior figures, do additional analyses and send
% results by e-mail. For example scripts like this, see
% https://github.com/torbencshl/BpodFunctions/
%% copy data to server
try
%CHANGE THIS TO 'homes\YOUR-ACCOUNT-NAME' OR to 'SHARED-FOLDER-NAME'
%examples: user = 'homes\torben'; % user name on server
% user = 'confidence'; % shared folder
user = strcat('homes\',getenv('username'));
%%%%%
[~,subject] = fileparts(fileparts(fileparts(fileparts(BpodSystem.DataPath))));
if ~isdir(fullfile('\\kepecsdata',user,'BpodData',subject,BpodSystem.CurrentProtocolName,'Session Data'))
mkdir(fullfile('\\kepecsdata',user,'BpodData',subject,BpodSystem.CurrentProtocolName,'Session Data'));
end
if ~isdir(fullfile('\\kepecsdata',user,'BpodData',subject,BpodSystem.CurrentProtocolName,'Session Settings'))
mkdir(fullfile('\\kepecsdata',user,'BpodData',subject,BpodSystem.CurrentProtocolName,'Session Settings'));
end
copyfile(BpodSystem.DataPath,fullfile('\\kepecsdata',user,'BpodData',subject,BpodSystem.CurrentProtocolName,'Session Data'));
copyfile(BpodSystem.SettingsPath,fullfile('\\kepecsdata',user,'BpodData',subject,BpodSystem.CurrentProtocolName,'Session Settings'));
catch
fprintf('Error copying data to server. Files not copied!\n');
end