From 16404fb5963dbccc430b442b5b78c4dc1966e8b8 Mon Sep 17 00:00:00 2001 From: Matthias Johnson Date: Sun, 1 Mar 2026 00:38:39 -0700 Subject: [PATCH] moving edit mode up and adding service example --- README.md | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 2f7e688..1ba3a74 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,27 @@ Note: `date -d` does not technically like "*in* 5 minutes" or "*at*" between day ## Usage -### Creating timer jobs +### Edit mode + +`systab -e` opens your editor with a pipe-delimited job list: + +``` +a1b2c3:n=backup | daily | /home/user/backup.sh +d4e5f6:i | *:0/15 | curl -s https://example.com +200816:s,n=syncthing | service | /usr/bin/syncthing --no-browser +g7h8i9:n=weekly-backup,e=user@host | weekly | ~/backup.sh +# aabbcc | hourly | echo "this job is disabled" +``` + +- Edit the schedule or command to update a job +- Delete a line to remove a job +- Add a line with `new` as the ID to create a job: `new | every 5 minutes | echo hello` +- Add a service with `new:s` and `service` as the schedule: `new:s,n=monitor | service | /usr/bin/my-monitor.sh` +- Comment out a line (`#`) to disable, uncomment to enable +- Append flags after the ID with `:` — `s` for service, `n=name` for naming, `i` for desktop notification, `e=addr` for email, `o` for output (default 10 lines), `o=N` for custom count, comma-separated (e.g., `a1b2c3:n=backup,i,o,e=user@host`) +- the formatting is just for us humans and whitespace will be stripped on save + +### Creating timer jobs via CLI ```bash # Command string (with optional name) @@ -162,24 +182,6 @@ systab -E backup systab -C ``` -### Edit mode - -`systab -e` opens your editor with a pipe-delimited job list: - -``` -a1b2c3:n=backup | daily | /home/user/backup.sh -d4e5f6:i | *:0/15 | curl -s https://example.com -g7h8i9:n=weekly-backup,e=user@host | weekly | ~/backup.sh -# aabbcc | hourly | echo "this job is disabled" -``` - -- Edit the schedule or command to update a job -- Delete a line to remove a job -- Add a line with `new` as the ID to create a job: `new | every 5 minutes | echo hello` -- Add a service with `new:s` and `service` as the schedule: `new:s,n=monitor | service | /usr/bin/my-monitor.sh` -- Comment out a line (`#`) to disable, uncomment to enable -- Append flags after the ID with `:` — `s` for service, `n=name` for naming, `i` for desktop notification, `e=addr` for email, `o` for output (default 10 lines), `o=N` for custom count, comma-separated (e.g., `a1b2c3:n=backup,i,o,e=user@host`) - ### Job IDs and names Each job gets a 6-character hex ID (e.g., `a1b2c3`) displayed on creation and in status output. You can also assign a human-readable name with `-n` at creation time. Names can be used interchangeably with hex IDs in `-D`, `-E`, `-S`, and `-L`. Names must be unique and cannot contain whitespace, pipes, or colons.