frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Ask HN: Is Claude Down for You?

21•philip1209•45m ago•17 comments

Ask HN: Best practice securing secrets on local machines working with agents?

6•xinbenlv•8h ago•8 comments

Ask HN: What's the best virtual Linux desktop experience on macOS for devs?

2•darkteflon•24m ago•1 comments

Ask HN: Claude Down?

3•emschwartz•40m ago•2 comments

Ask HN: Modern test automation software (Python/Go/TS)?

7•rajkumar14•2h ago•2 comments

Ask HN: What is your opinion on non-mainstream mobile OS options (e.g. /e/OS)?

5•sendes•5h ago•3 comments

Ask HN: Any good ressources facility location planning using GIS?

2•skalilopa•1h ago•0 comments

Ask HN: How do you verify cron jobs did what they were supposed to?

5•BlackPearl02•12h ago•3 comments

Ask HN: Industrial smart glasses with online / offline capabilities?

3•aureliusm•9h ago•0 comments

Ask HN: Anyone doing production image editing with image models? How?

3•geooff_•6h ago•0 comments

Ask HN: Is there any good open source model with reliable agentic capabilities?

4•baalimago•16h ago•0 comments

Tell HN: Drowning in information but still missing everything

5•akhil08agrawal•12h ago•5 comments

Ask HN: Unusual Network Filter

3•gman21•9h ago•0 comments

Ask HN: How do you authorize AI agent actions in production?

3•naolbeyene•8h ago•3 comments

Ask HN: Do you have any evidence that agentic coding works?

433•terabytest•2d ago•437 comments

Tell HN: 2 years building a kids audio app as a solo dev – lessons learned

132•oliverjanssen•1d ago•74 comments

Ask HN: Why are so many rolling out their own AI/LLM agent sandboxing solution?

27•ATechGuy•1d ago•11 comments

Ask HN: Thoughts on monitoring multi-chain staking and alerts with KoinyxBot

2•eeezl0dey•4h ago•0 comments

Ask HN: I'm sure more than just Microsoft is down rn

8•koconder•2h ago•4 comments

Ask HN: GitHub "files changed" tab change?

2•nonethewiser•6h ago•0 comments

Ask HN: COBOL devs, how are AI coding affecting your work?

168•zkid18•3d ago•183 comments

Ask HN: Does "Zapier for payment automation" exist?

8•PL_Venard•1d ago•12 comments

Ask HN: Revive a mostly dead Discord server

19•movedx•2d ago•28 comments

Tell HN: Claude session limits getting small

23•pragmaticalien8•1d ago•14 comments

Ask HN: Why does Google Maps still use mercator projection?

5•hbarka•16h ago•3 comments

Ask HN: Is GitHub Down?

11•AznHisoka•8h ago•5 comments

Tell HN: Avoid Cerebras if you are a founder

34•remusomega•1d ago•14 comments

Ask HN: How locked down are your work machines?

18•donatj•1d ago•22 comments

Ask HN: Do you have side income as a software engineer?

10•andrewstetsenko•6h ago•3 comments

Ask HN: Which common map projections make Greenland look smaller?

18•jimnotgym•2d ago•17 comments
Open in hackernews

Ask HN: How do you verify cron jobs did what they were supposed to?

5•BlackPearl02•12h ago
I've been running into this issue where my cron jobs "succeed" but don't actually do their job correctly.

For example:

Backup cron runs, exit code 0, but creates empty files

Data sync completes successfully but only processes a fraction of records

Report generator finishes but outputs incomplete data

The logs say everything's fine, but the results are wrong. Actually, the errors are probably in the logs somewhere, but who checks logs proactively? I'm not going through log files every day to see if something silently failed.

I've tried:

Adding validation in scripts - works, but you still need to check the logs

Webhook alerts - but you have to write connectors for every script

Error monitoring tools - but they only catch exceptions, not wrong results

I ended up building a simple monitoring tool that watches job results instead of just execution - you send it the actual results (file size, count, etc.) and it alerts if something's off. No need to dig through logs.

But I'm curious: how do you all handle this? Are you actually checking logs regularly, or do you have something that proactively alerts you when results don't match expectations?

Comments

krunck•1h ago
My way of doing things:

  1. Scripts should always return an error (>0) when things did not go as planned and 0 when they did. Always.
  2. Scripts should always notify you when they return >0. Either in their own way or via emails sent by Cron.
  3. Use chronic ( from Debian moreutils package) to ensure that cron jobs only email output when they ended in error. That way you don't need to worry about things sent to STDOUT spamming you.
  4. Create wrapper scripts for jobs that need extra functionality: notification, logging, or sanity checks.
PenguinCoder•13m ago
+1 for chronic. Very useful for knowing when a cron fails without needing to manually review every log run.
maliciouspickle•32m ago
this is not a direct answer to the original question, but problems like this are what let to the creation of orchestrator tools like airflow, luigi, dagster, prefect, etc.. these tools provide features which help increase task/job observability, ease of debugging, and overall reliability of scheduled jobs/tasks.

it is a natural progression to move on from cron and adopt an orchestrator tool (many options nowadays) when you need more insight into cron, or when you start finding yourself building custom features around it.

i would do some research into orchestators and see if there are any that meet your requirements. many have feature sets and integrations that’s solve some of the exact problems you’re describing

(as a data engineer my current favorite general purpose orchestrator is dagster. it’s lightweight yet flexible)

edit: as a basic example, in most orchestrators, there is a first class way to define data quality checks, if you have less data than expected, or erroneous data (based upon your expectations) you can define this as an automated check

you can then choose to fail the job, or set a number re-retries before failing , or send a notification to some destination of your choice( they have integrations with slack, and many other alerting tools)

i like dagster because it is geared for hooking into the data itself. you can use it to ‘run a job’ like a some function, but really it shines when you use its ‘data asset features’ that tracks the data itself over time, and provides a nice UI to view and compare data from each run over time. hook in alerting for anomalies and you’re good to go!

they have many more features depending on the tool , and some more or less complicated to set up.