From c3573eae6dfe11a24e3dde8a89b558ebad973d4a Mon Sep 17 00:00:00 2001 From: Bjorn Robertsson Date: Wed, 8 Jul 2026 13:00:02 +0100 Subject: [PATCH 1/2] Fix cron example in script documentation Swapped minutes/seconds on the 9:30 AM example --- docs/resources/script.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/script.md b/docs/resources/script.md index 21bfaec9..67a594ab 100644 --- a/docs/resources/script.md +++ b/docs/resources/script.md @@ -89,7 +89,7 @@ resource "coder_script" "shutdown" { ### Optional -- `cron` (String) The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `"0 0 22 * * *"` (daily at 10 PM), `"0 */5 * * * *"` (every 5 minutes), `"30 0 9 * * 1-5"` (weekdays at 9:30 AM). +- `cron` (String) The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `"0 0 22 * * *"` (daily at 10 PM), `"0 */5 * * * *"` (every 5 minutes), `"0 30 9 * * 1-5"` (weekdays at 9:30 AM). - `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons [here](https://github.com/coder/coder/tree/main/site/static/icon). Use a built-in icon with `"${data.coder_workspace.me.access_url}/icon/"`. - `log_path` (String) The path of a file to write the logs to. If relative, it will be appended to tmp. - `run_on_start` (Boolean) This option defines whether or not the script should run when the agent starts. The script should exit when it is done to signal that the agent is ready. From 642fe68ad121e8faa7bae5bf32ae2e633fe2ffc2 Mon Sep 17 00:00:00 2001 From: Bjorn Robertsson Date: Wed, 29 Jul 2026 10:00:35 +0100 Subject: [PATCH 2/2] fix: also update source for cron example The docs change was correct but the source in provider/script.go was omitted. For 6-field cron (seconds minutes hours day month weekday), 9:30 AM is `0 30 9 * * 1-5` not `30 0 9 * * 1-5`. Run make gen to keep docs in sync. --- provider/script.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/script.go b/provider/script.go index 23ddec6e..b6feddde 100644 --- a/provider/script.go +++ b/provider/script.go @@ -99,7 +99,7 @@ func scriptResource() *schema.Resource { ForceNew: true, Type: schema.TypeString, Optional: true, - Description: "The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `\"0 0 22 * * *\"` (daily at 10 PM), `\"0 */5 * * * *\"` (every 5 minutes), `\"30 0 9 * * 1-5\"` (weekdays at 9:30 AM).", + Description: "The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `\"0 0 22 * * *\"` (daily at 10 PM), `\"0 */5 * * * *\"` (every 5 minutes), `\"0 30 9 * * 1-5\"` (weekdays at 9:30 AM).", ValidateFunc: func(i interface{}, _ string) ([]string, []error) { v, ok := i.(string) if !ok {