generated from edgi-govdata-archiving/Template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_leg_info.sh
executable file
·33 lines (27 loc) · 1 KB
/
run_leg_info.sh
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
#!/bin/bash
source .profile
cd ${EEW_HOME}
CURRENTDATE=`date +"%Y-%m-%d"`
SAVENAME=leg_info.db-${CURRENTDATE}
IMAGESNAME=CD_images-${CURRENTDATE}.tar.xz
echo 'Saving the current leg_info.db' > leg_info.log
date >> leg_info.log
cp leg_info.db ${SAVENAME}
echo 'Saving the current leg images' >> leg_info.log
tar cf - CD_images | xz -e > ${IMAGESNAME}
rm CD_images/*
echo 'Saving the log file from the last population of leg_info.db' >> leg_info.log
SAVENAME=leg_info.log-${CURRENTDATE}
echo 'Cleaning out the affected tables' >> leg_info.log
sqlite3 leg_info.db < clean_leg_info.sql
echo 'Running the leg_info.py commands to populate leg_info.db' >> leg_info.log
date >> leg_info.log
python3 leg_info.py >> leg_info.log
date >> leg_info.log
python3 committees.py >> leg_info.log
date >> leg_info.log
echo 'Set the committees that should be included in reports'
sqlite3 leg_info.db < set_included_committees.sql
echo 'Running real_cds.py to build the real_cds table of regions.db'
# python3 real_cds.py
date >> leg_info.log