Commit graph

9 commits

Author SHA1 Message Date
Stephen Smoogen
bfb1320bc9 Add a countme for CentOS Stream 9 2022-01-05 13:48:34 -05:00
Nils Philippsen
337248e4eb Muffle one more cron job
Signed-off-by: Nils Philippsen <nils@redhat.com>
2021-10-04 21:45:04 +00:00
Stephen Smoogen
33df23d457 this will give copies of these emails to asaleh and nils so they can see how the cron jobs are working 2021-08-05 06:46:17 -04:00
Stephen Smoogen
b78179ed3c remove an email to smooge@smoogespace.com as debug is done 2021-08-04 08:38:42 -04:00
Stephen Smoogen
e21c30a720 Make the git countme email me at home so I can see if there is an error
Signed-off-by: Stephen Smoogen <smooge@smoogespace.com>
2021-05-27 12:37:51 -04:00
Stephen Smoogen
625441f66b remove wwoods and put mattdm as owner of this script.
Signed-off-by: Stephen Smoogen <smooge@smoogespace.com>
2021-03-29 08:43:25 -04:00
Stephen Smoogen
8d7d4f5389 when trying to find out why something is failing.. remove the /dev/null so that you can see why it is failing. Also add wwoods so he can delight in this. 2020-11-06 10:15:17 -05:00
Stephen Smoogen
1096f9b35f try to get the cron output to see why this is failing. 2020-11-06 10:07:15 -05:00
Will Woods
f8a5720535 add 'countme' stuff to web-data-analysis role
This should automate running the "countme" scripts every day to parse
new log data and publish updated totals.

Here's what I've added to the ansible role:

* install package deps for `mirrors-countme`
* make "countme" user with home /srv/countme
* clone 'prod' branch of https://pagure.io/mirrors-countme to /srv/countme
  * if changed: pip install /srv/countme/mirrors-countme
* make web subdir /var/www/html/csv-reports/countme
* make local data dir /var/lib/countme
* install `countme-update.sh` to /usr/local/bin
* install `countme-update.cron` to /etc/cron.d
  * runs /usr/local/bin/countme-update.sh daily, as user `countme`

That should make sure `countme-update.sh` runs every day.
That script works like this:

1. Run `countme-update-rawdb.sh`
  * parse new mirrors.fp.o logs in /var/log/hosts/proxy*
  * write data to /var/lib/countme/raw.db
2. Run `countme-update-totals.sh`
  * parse raw data from /var/lib/countme/raw.db
  * write updated totals to /var/lib/countme/totals.{db,csv}
3. Track changes in updated totals
  * set up /var/lib/countme as git repo (if needed)
  * commit new `totals.csv` (if changed)
4. Make updated totals public
  * Copy totals.{db,csv} to /var/www/html/csv-reports/countme

For safety's sake, I've tried to set up everything so it runs as the
`countme` user rather than running everything as `root`. This might be
an unnecessary complication but it seemed like the right thing to do.

Similarly, keeping totals.csv in a git repo isn't _required_, but it
seemed like a good idea to keep historical records in case we want/need
to change the counting algorithm or something.

I checked the YAML with ansible-lint and tested that all the scripts
work as expected when run as `wwoods`, so unless I've missed something
this should do the trick.
2020-10-13 16:17:00 +00:00