SShortSingh.
Back to feed

How Cron Expressions Work: Syntax, Examples, and Common Pitfalls

0
·25 views

Cron is a Unix-based job scheduler whose five-field syntax — covering minute, hour, day-of-month, month, and day-of-week — is now widely used in CI pipelines, cloud schedulers, and job queues. Each field supports special characters such as wildcards, ranges, lists, and steps, allowing expressions like '0 9 * * 1-5' to schedule a job at 9 AM on weekdays. A key pitfall is time zone handling: cron runs in the time zone of the host machine or service, which often defaults to UTC, potentially causing jobs to fire at unintended local times. In classic Vixie cron, restricting both the day-of-month and day-of-week fields triggers the job when either condition matches, not both — a behaviour that can catch developers off guard. Some schedulers such as Quartz and AWS EventBridge extend the standard five-field format with seconds or year fields, so users should always verify which dialect their tool expects before deploying.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Runway releases open-weight Praxis-1 robot model topping RoboLab-120 benchmark at 46.2%

Runway released Praxis-1 on November 11, 2026, a 27-billion-parameter world action model with open weights under Apache 2.0 that permits commercial use. The model reached 46.2% success on NVIDIA's RoboLab-120 leaderboard, placing it ahead of several competing systems. It jointly predicts future video and robot actions, returning 24 action steps in about 0.55 seconds on a single H100 GPU. Three checkpoints are available on Hugging Face, including a DROID fine-tune for single-arm tabletop tasks and a bimanual YAM variant. The article's author notes that these results come from Runway's own reporting and have not yet been independently reproduced.

0
ProgrammingDEV Community ·

Two Forgotten Smart Plugs Prompt a Home Automation Project Built With AI Agents

The author found two old Oakter smart plugs in storage and discovered that their dependence on a discontinued service made them effectively unusable. That prompted an investigation into whether the devices could be revived and, ultimately, a broader effort to build Pebble Home, a home automation platform. The author, who had roughly 80 smart devices from several vendors and multiple radio protocols, used AI coding agents to analyse protocols, debug integrations and build interfaces. The project has reshaped the author's views on how much control people truly have over the software behind their devices. The account is presented as a work in progress.

0
ProgrammingDEV Community ·

Shared household notes beat perfect memory, builders of TaskFamily find

A household task app called TaskFamily was built on the observation that families usually forget things because each detail belongs to a single person. The developers consolidated tasks, schedules and errands into one visible place, and they kept entries short so they could be written quickly and stay current. Finished items were cleared so the list remained easy to scan and trustworthy, and stale duplicate copies in other channels were eliminated to avoid contradictions. Notifications were limited to time-sensitive items after frequent alerts led people to ignore them. The authors acknowledge that the tool cannot by itself make households adopt the habit of recording information.

0
ProgrammingDEV Community ·

Label Created Is Not a Carrier Scan: Why Tracking States Should Stay Separate

A common mistake in carrier tracking systems is treating the first status a carrier returns as proof the parcel is in its hands, when that row often only means a shipping label or pre-advice was created. Such a record reflects that the carrier expects the parcel while it still sits with the shipper. Lumping this pre-scan state into an in-transit bucket distorts transit-time metrics, blurs which party owns a stuck-parcel alert, and produces customer messaging that can be contradicted. The proposed fix is to track a normalised status alongside a boolean for whether the carrier has scanned the parcel and the timestamp of that first scan. Transit time should then be measured from the first carrier scan, and matching should key on the meaning of status wording rather than on carrier-specific rules.