mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #37] Cron example should suppress stdout #18
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mgedmin on GitHub (Jan 24, 2016).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/37
https://healthchecks.io/docs/ recommends
But curl prints the response string (
OK) to stdout, which will cause cron to send an email. I suggest that you change the example to redirect the output to/dev/null.@mgedmin commented on GitHub (Jan 24, 2016):
Oh, and also pass the appropriate option to suppress the progress bar, otherwise you get emails like this:
@cuu508 commented on GitHub (Jan 24, 2016):
So a better curl invocation would be
-f makes curl treat non-200 responses as errors
-s Silent mode. Don’t show progress meter or error messages. Makes Curl mute.
-S When used with -s it makes curl show error message if it fails.
Or maybe use long options to make it self-documenting:
@mgedmin commented on GitHub (Jan 24, 2016):
Yes, the
-fsSline sounds good.Using the long form would make the snippet wider, which would make it less convenient to copy and paste. If anyone's curious, they can run
curl --helporman curland look up what-f,-sand-Smean.@mgedmin commented on GitHub (Jan 29, 2016):
It may be also useful to pass
--retry 10or something like that to curl. I've already had two spurious "host is down" notifications due to my hourly cron script failing withI'm hoping the
--retrywill help; time will tell if I'm right.