Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id AE5C1223C1B for <~alpine/users@lists.alpinelinux.org>; Sun, 31 Aug 2025 03:16:53 +0000 (UTC) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-336dd55aae1so930501fa.1 for <~alpine/users@lists.alpinelinux.org>; Sat, 30 Aug 2025 20:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756610210; x=1757215010; darn=lists.alpinelinux.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=TEotiUTwaqZAA8G8H+esTvaycKgzyZHMRMLYZ56IXfw=; b=b/rTUiOEiMMs3E+7gH108iiImGf0e+5pkFmTncomgnrOklzazwlHKd4BsAeL0SfBmM rJnTC0zXKtBySCiHCYtS/1X1vWxEZCnkzJY3qS/AZ1qsrmcfqrAvNzg3Ce4euLDilxtL 2dXKSojwTvboiv8pbmZkD1WnqFusvK94tw5Ir3eg0VvcHZpkYPJZufI/Pvhi/eP7IRk5 4dmQHga4vhorzRNdV8fpPsoQCHzQ5FQY/0uBZ0JWHsaXsiJcDD2j94Wzhg9KeTS9lGZZ oqpcBu49bY6JdtQ7bbTsjrUFkfAl3IQIsPtGzUUZ0A8TWYS2BSMFV+GFSwDwMgfcfMR8 p34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756610210; x=1757215010; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TEotiUTwaqZAA8G8H+esTvaycKgzyZHMRMLYZ56IXfw=; b=Daak6TIzELUeGuWa1uJ0zvZX67rrOudWAxyvVHbmHjxBsC5LGMF7sgIBk+8RbYoH2k PyqQcE6cMQemZi4JIo7dCHVJXKPZSt7vpVu6fHz3SHPSzeY0Q1/1ZsPijv/zdgW3bOf0 hBa8q+byxe6WV1ipErQebHQer8MUWpqH74quMw22hdgy5HMsUZWGj2ORHzSkWmUjeUAj yK+YAh98vQpy5mYMPD0TWmvcvzQPdCzSXOAzK4myMgXb4yZ8RFv1toHNQMf2HWTNBFxn LkRa1ibALw2KhwoW6K/0Bh4fKTuW8K6Wz0t7dleL0yiZ4yBb3mS2VijcE+ackio5O49r qJnQ== X-Forwarded-Encrypted: i=1; AJvYcCVpUvm/59KB7jGYSvwLINlhTcZxP9VPv/3fxPZQoBErIMxB8zErpJ+4zRDFGtY64KlLwjuBCq7twAQxv1Pb@lists.alpinelinux.org X-Gm-Message-State: AOJu0YyPZANeeGBCj5Yc5QBWpm8eiV9M78e0+ic6REVAzqtkOzGBe9z0 As5ZkhO6rKsKuywhLOow7oTCxKgNcIuPm1jeMoJSPwVRIQGIN8bQ1pKaBy1sG38NzNPAcEUT3YF 73z11Vu31hwEdH5mRnMtF5yFtPB7m/Y8= X-Gm-Gg: ASbGncs/liNbJ9zg+7RrukyQD+00ttWboCCa+NriMklBO65VNhGITx3vYXmbq6jmaoV pXxhtiPBkrMNqWGBKURy2j5XSNpj4frX1q5W/y5p8EywccMZB3Eir+yUGHzcXphyff4v9z3spAs QUB3yeFik60Xu2hNOFfkm4ApCsEIHdX/FaGak6WuHCTQqYDgyraG8Y4QidtOp0nm6WVjdn/PqP3 seb2zUE3A== X-Google-Smtp-Source: AGHT+IGJt3YDB/Se79m8Fc9vTmOkD5JpDdp2yBHGYjR02Pcb1HxkiHIuxSwOV4CwzEx3JKjYITqaj6UYy1cF2vulMe4= X-Received: by 2002:a2e:be8f:0:b0:336:d612:e8a6 with SMTP id 38308e7fff4ca-336d612e968mr3405191fa.10.1756610209685; Sat, 30 Aug 2025 20:16:49 -0700 (PDT) MIME-Version: 1.0 References: <9e46853a-fcdd-5673-d243-65c244026117@web.de> In-Reply-To: From: Prabu Anand Kalivaradhan Date: Sun, 31 Aug 2025 08:46:13 +0530 X-Gm-Features: Ac12FXyciKyKepaDa0hnyPT5zHJeMw1pkvuOSwrBqOjMLsah-UEEAnD-r8c1i3g Message-ID: Subject: Re: Problem with crontab To: Wolfgang Klein , ~alpine/users@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="0000000000008ea5fa063da0af8e" --0000000000008ea5fa063da0af8e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the note, Andreas. wiki updated. On Sun, 31 Aug 2025 at 01:00, Andreas K=C3=A4h=C3=A4ri wrote: > On Sat, Aug 30, 2025 at 08:58:05PM +0200, Wolfgang Klein wrote: > > Hello, > > > > in my crontab there are these two entries: > > > > > > 7,37 0-7,18-23 * * 1-5 command > > 7,37 * * * 6,7 command > > > > > > "Command" needs to be executed every 30 minutes, *except* during office > > hours. That's why there are two lines: one that's to be executed Monday > to > > Friday, and one on Saturday and Sunday. > > > > On Ubuntu, this has been working perfectly as expected for years now. O= n > > Alpine, the DOW field seems to be ignored somehow: "command" is execute= d > > every 30 minutes on each day of the week! It seems that the second call > is > > executed regardless of the DOW entry. > > > > Does cron on Alpine need a different syntax? Does it not know about the > DOW > > option? > > > > Thanks in advance for any help! > > > > > > Regards, > > > > Wolfgang > > > > > > The busybox cron does not understand "7" as a valid day of the > week. The Vixie cron daemon allows for using either "0" or "7" > as Sunday, but busybox cron only allows "0" for Sunday (as per > POSIX). > > So you need to change your second line to: > > 7,37 * * * 6,0 command > > I ran into this myself a while ago and decided to look deeper into the > busybox cron source code to confirm this. > > See my issue and resolution here: > > https://unix.stackexchange.com/questions/783517 > > -- > Matti Andreas K=C3=A4h=C3=A4ri (Kusalananda) > Uppsala, Sweden > > . > --0000000000008ea5fa063da0af8e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the note,=C2=A0Andreas.= =C2=A0=C2=A0wiki=C2= =A0updated.

On Sun, 31 Aug 2025 at 01:00, Andrea= s K=C3=A4h=C3=A4ri <andreas.kah= ari@abc.se> wrote:
On Sat, Aug 30, 2025 at 08:58:05PM +0200, Wolfgang Klein wrote:<= br> > Hello,
>
> in my crontab there are these two entries:
>
>
> 7,37=C2=A0 0-7,18-23=C2=A0 =C2=A0 =C2=A0 =C2=A0*=C2=A0 =C2=A0 =C2=A0 = =C2=A0*=C2=A0 =C2=A0 =C2=A0 =C2=A01-5=C2=A0 =C2=A0 =C2=A0command
> 7,37=C2=A0 *=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*= =C2=A0 =C2=A0 =C2=A0 =C2=A0*=C2=A0 =C2=A0 =C2=A0 =C2=A06,7=C2=A0 =C2=A0 =C2= =A0command
>
>
> "Command" needs to be executed every 30 minutes, *except* du= ring office
> hours. That's why there are two lines: one that's to be execut= ed Monday to
> Friday, and one on Saturday and Sunday.
>
> On Ubuntu, this has been working perfectly as expected for years now. = On
> Alpine, the DOW field seems to be ignored somehow: "command"= is executed
> every 30 minutes on each day of the week! It seems that the second cal= l is
> executed regardless of the DOW entry.
>
> Does cron on Alpine need a different syntax? Does it not know about th= e DOW
> option?
>
> Thanks in advance for any help!
>
>
> Regards,
>
> Wolfgang
>
>

The busybox cron does not understand "7" as a valid day of the week. The Vixie cron daemon allows for using either "0" or "= 7"
as Sunday, but busybox cron only allows "0" for Sunday (as per POSIX).

So you need to change your second line to:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 7,37=C2=A0 *=C2=A0 *=C2=A0 *=C2=A0 6,0=C2=A0 co= mmand

I ran into this myself a while ago and decided to look deeper into the
busybox cron source code to confirm this.

See my issue and resolution here:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://unix.stackexchang= e.com/questions/783517

--
Matti Andreas K=C3=A4h=C3=A4ri (Kusalananda)
Uppsala, Sweden

.
--0000000000008ea5fa063da0af8e--