From 944097d1c9b25b70af9deabb02b95b0cb9abd280 Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Sat, 23 May 2020 10:26:03 +0100 Subject: [PATCH] cron FAQ --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 9602c3d..e63b358 100644 --- a/README.md +++ b/README.md @@ -290,3 +290,20 @@ Assuming you're running a systemd powered linux distribution (most of them are): to `/etc/systemd/system/` 2. Run `sudo systemctl daemon-reload` to get systemd to see it 3. Then run `sudo systemctl enable dsnet` to enable it at boot + +> How can I generate the report periodically? + +Either with cron or a systemd timer. Cron is easiest: + + echo '* * * * * root /usr/local/bin/dsnet report | sudo tee /etc/cron.d/dsnetreport' + +Note that whilst report generation requires root, consuming the report does not +as it's just a world-readable file. This is important for web interfaces that +need to be secure. + +This is also why dsnet loads its configuration from a file -- it's possible to +set permissions such that dsnet synchronises the config generated by a non-root +user. Combined with a periodic `dsnet sync` like above, it's possible to build +a secure web interface that does not require root. A web interface is currently +being created by a friend; it will not be part of dstask, rather a separate +project.