|
|
@@ -15,6 +15,7 @@ def main():
|
|
15
|
15
|
surgery_list = glob.glob(hdd_root)
|
|
16
|
16
|
|
|
17
|
17
|
for id in surgery_list:
|
|
|
18
|
+ #id = /hdd/********
|
|
18
|
19
|
if 'lost+found' in id:
|
|
19
|
20
|
surgery_list.remove(id)
|
|
20
|
21
|
else:
|
|
|
@@ -22,7 +23,9 @@ def main():
|
|
22
|
23
|
|
|
23
|
24
|
for id in surgery_list:
|
|
24
|
25
|
file_list=glob.glob(id + '/*')
|
|
|
26
|
+
|
|
25
|
27
|
for file in file_list:
|
|
|
28
|
+ #file = /hdd/**********/*.csv, svo, txt
|
|
26
|
29
|
if 'log.txt' in file:
|
|
27
|
30
|
f = open(file, 'rt')
|
|
28
|
31
|
logs = f.readlines()
|
|
|
@@ -43,11 +46,10 @@ def main():
|
|
43
|
46
|
transport.connect(username='mc365', password='tkadbrdhmc1!')
|
|
44
|
47
|
sftp = paramiko.SFTPClient.from_transport(transport)
|
|
45
|
48
|
#FIXME: send file recursively
|
|
46
|
|
-
|
|
47
|
|
- #sftp.put(filepath, data_root_dir + filepath[1:])
|
|
|
49
|
+ for file in file_list:
|
|
|
50
|
+ sftp.put(file,'/data/'+str(file[5:]))
|
|
48
|
51
|
sftp.close()
|
|
49
|
|
- transport.close()
|
|
50
|
|
-
|
|
|
52
|
+ transport.close()
|
|
51
|
53
|
else:
|
|
52
|
54
|
pass
|
|
53
|
55
|
|