-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp.py
More file actions
38 lines (32 loc) · 1.14 KB
/
temp.py
File metadata and controls
38 lines (32 loc) · 1.14 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
from minio import Minio
from minio.error import ResponseError
import glob
import tarfile
import shutil
minioClient = Minio('s3nverchev.ugent.be',
access_key='M12AX6PRAW2HUPUHPTL0',
secret_key='yC2UlxBD+exlGz5S+zLaVclYUvRQ9D8msgOMVAWh',secure=True)
#
# with open("err.txt",'w') as file:
# file.write(str(0))
#
# for subject in sorted(glob.glob("../data_vo/*")):
# print(subject)
# for operator in sorted(glob.glob(subject+'/*')):
# with open("err.txt", 'w') as file:
# file.write(operator)
# tarname=operator.split('/')[-1]+'_'+str(subject[-2:])+".tar.gz"
# tar = tarfile.open(tarname, "w:gz")
# tar.add(operator)
# tar.close()
# with open("err.txt", 'w') as file:
# file.write(str(1))
# minioClient.fput_object('coma', tarname, tarname)
# with open("err.txt", 'w') as file:
# file.write(str(2))
# shutil.rmtree(tarname)
# with open("err.txt", 'w') as file:
# file.write(str(3))
# print(operator)
tarname= 'Di_02.tar.gz'
minioClient.fput_object('coma','~/data_vo/'+tarname, tarname)