From d3b5546ae9993dbcac5de37f9909a3d3797a6aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20T=2E=20Jochym?= Date: Fri, 6 Mar 2026 11:02:06 +0100 Subject: [PATCH] fix: correct Systemd OnCalendar syntax by omitting '*' for Weekday --- src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f69c172..97406e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -838,7 +838,13 @@ function cronToSystemdCalendars(cron: string): string[] { for (const domValue of domValues) { for (const monthValue of months) { for (const dowValue of dowValues) { - calendars.push(`${dowValue} *-${monthValue}-${domValue} ${hourValue}:${minuteValue}:00`) + const datePart = `*-${monthValue}-${domValue}` + const timePart = `${hourValue}:${minuteValue}:00` + const calendar = + dowValue === "*" + ? `${datePart} ${timePart}` + : `${dowValue} ${datePart} ${timePart}` + calendars.push(calendar) } } }