summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/stats/arafetch.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-04-24 19:28:09 +0200
committertv <tv@krebsco.de>2018-04-24 19:28:09 +0200
commit21053de317e838c06a20425bdb3e81b7ac132d83 (patch)
treed722f9c2a525d6d66310da5e86dbcff73c79672a /makefu/2configs/stats/arafetch.nix
parent0fe9b28302c905523f2ecefadfd167e1547785f9 (diff)
parentc99e8256b223761eb50cf5d6841ab64f989851c3 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/stats/arafetch.nix')
-rw-r--r--makefu/2configs/stats/arafetch.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/makefu/2configs/stats/arafetch.nix b/makefu/2configs/stats/arafetch.nix
index e04b12f9c..422676b24 100644
--- a/makefu/2configs/stats/arafetch.nix
+++ b/makefu/2configs/stats/arafetch.nix
@@ -3,7 +3,7 @@ with import <stockholm/lib>;
let
pkg = with pkgs.python3Packages;buildPythonPackage rec {
rev = "762d747";
- name = "europastats-${rev}";
+ name = "arafetch-${rev}";
propagatedBuildInputs = [
requests
docopt
@@ -25,12 +25,25 @@ in {
};
systemd.services.arafetch = {
- startAt = "Mon 09:15:00";
+ startAt = "Mon,Wed,Fri 09:15:00";
wantedBy = [ "multi-user.target" ];
environment = {
OUTDIR = home;
};
path = [ pkg pkgs.git pkgs.wget ];
- script = "${pkg}/bin/weekrun";
+ serviceConfig = {
+ User = "arafetch";
+ WorkingDirectory = home;
+ PrivateTmp = true;
+ ExecStart = pkgs.writeDash "start-weekrun" ''
+ set -x
+ weekrun || echo "weekrun failed!"
+ find $OUTDIR/db -name \*.json | while read path;do
+ file=''${path##*/}
+ cantine=''${file%%.json}
+ ara2influx $path --cantine $cantine --host wbob.r
+ done
+ '';
+ };
};
}