Score:0

Dillon's dcron SYNC and ASYNC

dk flag

The specific question for cron using Dillon's minimalist cron version is:

How to create a cron job that runs every first Friday of the month, in ASYNC mode?


Dillon's cron attempts to mix synchronous cron (the traditional) and asynchronous (anacron style) in a single daemon.

The idea is great, but the execution not so much, as one needs to read attentively what makes a cron entry SYNC or ASYNC. (It would be better just to have a TAG like SYNC and ASYNC in the line, and end this problem, but I diverge).

From what I understand, lines that causes the behavior to be ASYNC are those that uses the formats

  • @freq ID command or
  • * * * * * ID FREQ=X command.

Those will create a file at /var/spool/cron/cronstamps.

To create a SYNC entry that runs every first Friday of the month, it would be, for example:

10 5 1 * fri ID=scrubzpool /sbin/zpool scrub tank

And to make this ASYNC, once a month (but not every first Friday), the options would be:

@monthly ID=scrubzpool /sbin/zpool scrub tank

Maybe there is a way to explain month on FREQ= tag, but I'm not sure. The best I could come up with was 4 weeks:

10 5 1 * * ID=scrubzpool FREQ=4w /sbin/zpool scrub tank

The github code is here, but with special relation to this question is the file database.c , function ParseInterval, line 677.

I cannot find any explanation on how to mix FREQ= with traditional cron entry to achieve every first Friday of the month.

I wonder if this is correct:

10 5 1 * fri ID=scrubzpool FREQ=4w /sbin/zpool scrub tank

Or something that could create such result.

dk flag
I added the last command line from the question above to a crontab, and the spool says it will run after `2023-05-04 16h17`, which is a Thursday. Not sure if the file just marks the inferior limit, and the cron syntax will be applied at a later point.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.