bin/update-github-list: cron updater script
This commit is contained in:
parent
5bd3ab91f3
commit
ce3f9fd17f
1 changed files with 17 additions and 0 deletions
17
bin/update-github-list
Executable file
17
bin/update-github-list
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
dbservice=github
|
||||
dbconn="service=${dbservice}"
|
||||
psql="psql --no-psqlrc --pset t --pset format=unaligned ${dbconn}"
|
||||
|
||||
export PYTHONPATH=$HOME/src/github-list-repos/
|
||||
logfile=$HOME/.cache/ghlister/log/ghlister.$(date +%Y%m%d).log
|
||||
|
||||
# catchup with recent changes
|
||||
$HOME/src/github-list-repos/bin/ghlister catchup &> $logfile
|
||||
|
||||
# compute and store current totals
|
||||
all_repos=$(echo "select count(*) from repos" | $psql)
|
||||
fork_repos=$(echo "select count(*) from fork_repos" | $psql)
|
||||
orig_repos=$(echo "select count(*) from orig_repos" | $psql)
|
||||
echo "insert into repos_history(repos, fork_repos, orig_repos) values (${all_repos}, ${fork_repos}, ${orig_repos})" | $psql > /dev/null
|
Loading…
Add table
Add a link
Reference in a new issue