From dcb855be85f2318ccf7ea0c75f1ed8dbc47c2f6b Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 14 Jun 2023 19:39:20 +0200 Subject: [PATCH] docs: add TODOs --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 2d68eaf..f9d72d2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,31 @@ * Send email notification if command fails with [de-p1st-execNotify](src/de/p1st/exec_notify/execNotify.py). * Send unconditional notifications with [de-p1st-notify](src/de/p1st/exec_notify/notify.py). +## TODOs + +~~* Send notification about unread local mail only once!~~ +* Rename python module (and git repository?) to `exec-notify` +* Use subprocess_util > execute_print_capture + * This way, the user can see the stdout/stderr while it is executed + * And we can email the stdout/stderr if the process has failed + +* New program flow: + * Read configuration from `/etc/exec-notify` -> `work_dir` (default: `~/exec-notify`) + * Create file `$work_dir` / `$start_date-$id.args` with `$args` as content, e.g. `ls foo bar` + + * If one or more .exit_code files exists and `$end_date` of at least one .exit_code file is older than 1 minute, then try to send email + * If email was sent: + * delete corresponding .exit_code, .stdout, .stderr, .args + * continue + * Else: + * continue + + * Execute `$args` and redirect stdout/stderr to `$work_dir` / `$start_date-$id.{stdout,stderr}` + * If error occurred, create file `$work_dir` / `$start_date-$id-$end-date.exit_code` with content `$exit_code` + * Then, send email and if successful delete .exit_code file + * Delete .args, .stdout, .stderr files + * If error was reported, exit(1), else exit(0) + ## Installation ### Installation - global