| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import os
- import sys
- import glob
- import time
-
-
- hdd_root = '/hdd/*'
-
- def main():
- surgery_list = glob.glob(hdd_root)
-
- for id in surgery_list:
- if 'lost+found' in id:
- surgery_list.remove(id)
- else:
- pass
-
- for id in surgery_list:
- file_list=glob.glob(id + '/*')
- for file in file_list:
- if 'log.txt' in file:
- f = open(file, 'rt')
- logs = f.readlines()
- f.close()
- if len(logs) == 2:
- f = open(file, 'at')
- r_time = time.ctime(time.time())
- f.write('exectue is successfully starts at ' + str(r_time) + '\n')
- f.close()
- os.system('docker run --rm --name extract_1 --gpus '"device=0"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/extract_01.py ' + id + '/ >> /dev/null')
- os.system('docker run --rm --name extract_2 --gpus '"device=1"' -v /dev:/dev -v /home/mc365/sources:/sources -v /hdd:/hdd ellishuntingmoon/mailsys:0.4 python3 /sources/extract_02.py ' + id + '/ >> /dev/null')
- f = open(file, 'at')
- r_time = time.ctime(time.time())
- f.write('exectue is successfully ends at ' + str(r_time) + '\n')
- f.close()
- else:
- pass
-
- if __name__ == '__main__':
- while True:
- main()
|