-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathcron1
More file actions
executable file
·22 lines (22 loc) · 820 Bytes
/
cron1
File metadata and controls
executable file
·22 lines (22 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
# By Tony Pearson, IBM, 2020
#
# This script runs the application with SQLite3 (see STAGE1.md for details)
# Designed for use with operating system "cron" for background tasks
#
# Examples:
#
# cron1 get_api_data Invokes Legiscan.API and creates AZ.json, OH.json
# cron1 scan_json Scans AZ.json and OH.json, converts PDF/HTML -> TXT
# cron1 analyze_text Analyzes TXT files, assigns IMPACT, loads database
# cron1 update_seed Update sources/cfc-seed.json file
#
parms="$@"
export USE_SQLITE3='True'
if [[ "$#" == 1 && "$1" == "update_seed" ]] ; then
tables="auth.user users.profile cfc_app.criteria cfc_app.impact cfc_app.location"
outfile="--output sources/cfc-seed.json"
parms="dumpdata $tables $outfile"
fi
echo $parms
cd ~/Develop/Legit-Info && pipenv run python manage.py $parms