From 04a73ae1a2ab15e53ff51e64c125260c3d972cd4 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Mon, 15 Jul 2024 12:51:45 +0200 Subject: [PATCH] add --- README.md | 3 ++- systemd/measurer.service | 11 +++++++++++ systemd/measurer.timer | 10 ++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 systemd/measurer.service create mode 100644 systemd/measurer.timer diff --git a/README.md b/README.md index d4f5a59..2e8fcd9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ Ambient temperature is read from `/sys/bus/w1/devices` so you must have 1wire en # compilation and usage `make` or `gcc main.c -o measurer` \ Should throw no warnings \ -`./measurer ` +`./measurer ` \ +You can schedule this with [systemd](/src/branch/master/systemd) # why like heavy ahh like databases grafana etc go away you're a performance monitor why'd you reduce performance \ No newline at end of file diff --git a/systemd/measurer.service b/systemd/measurer.service new file mode 100644 index 0000000..03f5076 --- /dev/null +++ b/systemd/measurer.service @@ -0,0 +1,11 @@ +[Unit] +Description=measurer + +[Service] +User=pi +Group=pi +WorkingDirectory=/home/pi/measurer +ExecStart=/home/pi/measurer/measurer /home/pi/measurer/data.csv + +[Install] +WantedBy=multi-user.target diff --git a/systemd/measurer.timer b/systemd/measurer.timer new file mode 100644 index 0000000..29ac0ae --- /dev/null +++ b/systemd/measurer.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Say Hello every 10 seconds + +[Timer] +OnBootSec=10 +OnUnitActiveSec=10 +AccuracySec=1 + +[Install] +WantedBy=timers.target