-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_dropper_maker.sh
More file actions
executable file
·27 lines (21 loc) · 935 Bytes
/
db_dropper_maker.sh
File metadata and controls
executable file
·27 lines (21 loc) · 935 Bytes
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
#!/bin/zsh
# 1) copy today's database to temp database.
# 2) delete original database
# 3) use source db to make next day's database.
# 4) use the temp database to make geojson of the day with R script.
# 6) take route outputs from daily geojson and create single geojsons for each route dir
# 7) delete the temp database
cd /Users/maxgrossman/github/maxgrossman/dclatebus
# create the temporary database
createdb -O maxgrossman -T wmata_routes wmata_routes_temp
# drop the database for today
dropdb wmata_routes
# recreate the wmata_route database for next day
createdb -O maxgrossman -T wmata_routes_orig wmata_routes
# make the daily geojsons
current_date=$(date "+%Y-%m-%d")
mkdir data/dir0routes/dailygeojson/$current_date
mkdir data/dir0routes/dailycsv/$current_date
mkdir data/dir1routes/dailygeojson/$current_date
mkdir data/dir1routes/dailycsv/$current_date
Rscript R/Day_GeoJSON_maker.R