The question was simple… Give me the cron (not Quartz) expression for scheduling a task to run every second Saturday of the month.Every chatbot I tried (ChatGPT, Claude, DeepSeek, Gemini, and Grok) gave the wrong answer.The correct answer is:0 0 8-14 * */6Can these bots actually read man pages? (Pun intended.)
From o3-mini-high:Standard cron doesn’t have a direct way to specify ‘the second Saturday of the month.’ Cron fields work with OR logic, meaning a rule like this:0 0 8-14 * 6won’t do what you want because it runs on all Saturdays and all days from the 8th to 14th.A better way is to schedule the job for every day in that range and filter Saturdays with a command like:0 0 8-14 * * [ “$(date +%u)” -eq 6 ] && /path/to/your/commandThis ensures your task runs only when it’s actually Saturday.
@Whit
0 0 8-14 * 6 is wrong because it runs on every Saturday in that range.
Remi said:
@Whit
0 0 8-14 * 6 is wrong because it runs on every Saturday in that range.
Did you actually read the full comment?
Remi said:
@Whit
0 0 8-14 * 6 is wrong because it runs on every Saturday in that range.
Did you actually read the full comment?
Yes, and I still don’t see the correct answer anywhere.
@Remi
It’s a working solution, even if it’s not the one you prefer.
Sloan said:
@Remi
It’s a working solution, even if it’s not the one you prefer.
How would I use this with pg_cron? If this is correct, then why even use cron at all? Might as well just loop in a script and check dates manually. A proper solution exists, but some people don’t care about real engineering.
@Remi
This is just frustration talking. Are you really trying to make a career out of obscure cron expressions? AI will handle most of this soon anyway…
Sloan said:
@Remi
This is just frustration talking. Are you really trying to make a career out of obscure cron expressions? AI will handle most of this soon anyway…
This thread is giving ‘I’m very smart’ vibes.
Interesting. ChatGPT suggested:0 0 8-14 * 6 Still wrong but at least getting closer. Somebody should ask DeepSeek…
Cleo said:
Interesting. ChatGPT suggested:0 0 8-14 * 6 Still wrong but at least getting closer. Somebody should ask DeepSeek…
DeepSeek is always overloaded at certain hours… almost feels like someone is intentionally flooding it so half the world can’t use it.
Sloan said:
@Indy
Or… maybe it’s just popular? Not everything is a conspiracy.
Or maybe he has a point?
DeepSeek R1 suggests: 0 * * 6#2
### Breakdown:- Runs at midnight- Every second (#2
) Saturday (6
)If your system doesn’t support #
, another option is:0 0 8-14 * 6
This runs on Saturdays that fall between the 8th and 14th, which should be the second Saturday of each month.
@Tate
First one is Quartz syntax, and the second one runs every Saturday in that range, not just the second Saturday.
Remi said:
@Tate
First one is Quartz syntax, and the second one runs every Saturday in that range, not just the second Saturday.
Yeah, but the second Saturday always falls in that range, so it still works.
This is just a logic problem. Language models don’t ‘think’—they just predict text based on what they’ve seen before. If you need real computation, you have to hook them up to a tool that can do it. People keep expecting AI to be something it isn’t yet.
Wait… AI isn’t perfect yet? Shocking!