docs: add TODOs

This commit is contained in:
Daniel Langbein 2023-06-14 19:39:20 +02:00
parent fc2e8094a6
commit dcb855be85

View File

@ -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