From db1f56c539309b8a02adff114d765c725ac5ff8a Mon Sep 17 00:00:00 2001 From: "Max P." Date: Wed, 21 May 2025 03:10:54 +0200 Subject: [PATCH] docs: add README for systemd-timer CLI tool - Introduces a README file describing the systemd-timer tool - Highlights features, installation steps, and usage examples - Provides details on testing, development, and required permissions --- README.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2f03c36 --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# systemd-timer + +Ein einfaches CLI-Tool zum schnellen Erzeugen von systemd `.service` und `.timer` Units – als Ersatz oder moderne Ergänzung zu klassischen `cron`-Jobs. + +--- + +## 🚀 Features + +- Erzeugt `.service` und `.timer` Dateien per CLI +- Unterstützt `--user` Timer (für `~/.config/systemd/user/`) +- Optionales Logging (`StandardOutput/StandardError`) +- Unterstützt: + - `--calendar` + - `--exec` + - `--after` + - `--environment` + - `--output` + - `--dry-run` +- Getestet und typisiert mit Deno + Cliffy + +--- + +## 🛠️ Installation + +```bash +git clone https://git.0xmax42.io/maxp/systemd-timer.git +cd systemd-timer +deno task build + +# Binary liegt nun unter ./systemd-timer +./systemd-timer --help +``` + +--- + +## 📦 Beispiel + +```bash +./systemd-timer create \ + --exec "/usr/local/bin/backup.sh" \ + --calendar "Mon..Fri 02:00" \ + --description "Backup Job" \ + --user \ + --logfile "/var/log/backup.log" +``` + +Erzeugt: +- `~/.config/systemd/user/backup.service` +- `~/.config/systemd/user/backup.timer` + +Anschließend aktivieren: + +```bash +systemctl --user daemon-reload +systemctl --user enable --now backup.timer +``` + +--- + +## 🧪 Tests ausführen + +```bash +deno task test +``` + +--- + +## 🧰 Entwickeln + +```bash +deno task start create --exec "/bin/true" --calendar "daily" --dry-run +``` + +--- + +## 🔒 Rechte / Flags + +Das Tool benötigt beim Ausführen bzw. Kompilieren: + +- `--allow-env` (für `$HOME`) +- `--allow-write` (zum Schreiben von `.service`/`.timer`) + +Beim Entwickeln wird meist `-A` (allow all) verwendet. + +--- + +## 📝 Lizenz + +[MIT License](LICENSE)