% create folder folder_name = datestr(now,'yy_mm_dd_HH:MM'); folder_name = strrep(folder_name,':','_'); mkdir(folder_name) disp(['Creating backup of all modified files to ',folder_name]) % define filename for the list of modified files filename = 'file_list.txt'; % define repos base repos_base = '/home/robocup/svn/trunk/src/Turtle2'; % store current path currentpath = pwd; % go to svn folder cd (repos_base) % create a list with all modified files cmd = ['!svn st | grep ^M > ',currentpath,'/',folder_name,'/',filename]; eval(cmd) % go to backup folder cd(currentpath) cd(folder_name) %% open file and read the file list fid = fopen(filename); C = textscan(fid,'%s %s'); fclose(fid); files = C{2}; for k=1:length(files) disp(['Backup : ',files{k}]) cmd = ['!cp ',repos_base,'/',files{k},' .']; eval(cmd); end cd(currentpath)