-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto_update.py
36 lines (30 loc) · 1.3 KB
/
auto_update.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
# -*- coding: utf-8 -*-
#几个bash命令,以及调用的.py文件内的bash命令,访问顺序是什么样的
#用于每日调用,更新model以及依赖文件
import sys
import os
from datetime import datetime
today=datetime.today()
print "begin at "+today.strftime('%Y-%m-%d %H:%M')
#prepare data
#gfs
os.system('python /home/suber/projects/pm25/datacode/download_gfs.py')
print "gfs downloading finished"
gfsdir='/ldata/pm25data/gfs/'
os.system('find '+gfsdir+' -type f -size 0 -exec rm -f {} \;')
print "empty gfs files deleted"
#pm25 mean
os.system('python /home/suber/projects/pm25/datacode/pm25_mean.py')
print "pm25 mean generated"
#update dataset
#os.system('python /home/suber/projects/pm25/datacode/pm25_dataset_maker0518.py')
os.system('python /home/suber/projects/pm25/datacode/pm25_dataset_maker0605.py')
print "dataset generated"
#update model
#os.system('python /home/suber/projects/pm25/model/pm25_mlp.py')
os.system('python /home/suber/projects/pm25/model/pm25_mlp0605.py')
print "model trained"
#rsync
os.system('rsync -av /ldata/pm25data/pm25model/MlpModel'+today.strftime('%Y%m%d')+'.pkl.gz [email protected]:/ldata/pm25data/pm25model/')
os.system('rsync -avr /ldata/pm25data/pm25mean/mean'+today.strftime('%Y%m%d')+' [email protected]:/ldata/pm25data/pm25mean/')
print "rsync finished"