/
createdir.py
39 lines (28 loc) · 864 Bytes
/
createdir.py
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
37
38
#!/usr/bin/python2.5
import os
from time import strftime
def createdir(today,filepath):
if os.access(filepath+today+'/images',os.F_OK):
pass
else:
os.makedirs(filepath+today+'/images')
if os.access(filepath+today+'/images/raw',os.F_OK):
pass
else:
os.mkdir(filepath+today+'/images/raw')
if os.access(filepath+today+'/images/sorted',os.F_OK):
pass
else:
os.mkdir(filepath+today+'/images/sorted')
if os.access(filepath+today+'/images/sorted/990',os.F_OK):
pass
else:
os.mkdir(filepath+today+'/images/sorted/990')
if os.access(filepath+today+'/trackfile',os.F_OK):
pass
else:
os.mkdir(filepath+today+'/trackfile')
if __name__ == "__main__":
today=strftime("%Y-%m-%d")
filepath='/srv/trackdata/bydate/'+str(today)
createdir(today,filepath)