-
Notifications
You must be signed in to change notification settings - Fork 8
/
charts_job.py
37 lines (30 loc) · 1.17 KB
/
charts_job.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
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.schedulers.background import BackgroundScheduler
import logging
import psycopg2
from UnoCPI import sqlfiles,settings
import os
# import charts_campuspartner_json,charts_communitypartner_json,charts_missionsubcat_json,charts_project_json
#sched = BlockingScheduler()
#sched1 = BackgroundScheduler()
logger=logging.getLogger("UNO CPI Application Charts Batch job")
#@sched.scheduled_job('cron', day_of_week='mon-sun', hour=2)
def main():
print('This job is run every day at GMT/ 11 PM CDT.')
projectScript = 'python charts_project_json.py'
communityScript = 'python charts_communitypartner_json.py'
campusScript = 'python charts_campuspartner_json.py'
missionScript = 'python charts_missionsubcat_json.py'
print("Start project script")
os.system(projectScript)
print("End project script")
print("Start community script")
os.system(communityScript)
print("End community script")
print("Start campus script")
os.system(campusScript)
print("End campus script")
print("Start mission script")
os.system(missionScript)
print("End mission script")
main()