{"id":18370196,"url":"https://github.com/docwhat/chronic","last_synced_at":"2025-04-06T18:32:48.202Z","repository":{"id":6958408,"uuid":"54695949","full_name":"docwhat/chronic","owner":"docwhat","description":"A tool that hides output unless the command fails; now in Go!","archived":false,"fork":false,"pushed_at":"2024-05-16T21:08:51.000Z","size":97,"stargazers_count":31,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T04:51:15.147Z","etag":null,"topics":["ci-tools","cron","golang","sysadmin-tool"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docwhat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-25T05:09:56.000Z","updated_at":"2025-01-03T17:02:23.000Z","dependencies_parsed_at":"2024-11-05T23:38:45.067Z","dependency_job_id":"a5cd8284-5e73-4fdf-916b-4e1fa066303b","html_url":"https://github.com/docwhat/chronic","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docwhat%2Fchronic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docwhat%2Fchronic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docwhat%2Fchronic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docwhat%2Fchronic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docwhat","download_url":"https://codeload.github.com/docwhat/chronic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247531429,"owners_count":20953962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-tools","cron","golang","sysadmin-tool"],"created_at":"2024-11-05T23:37:12.322Z","updated_at":"2025-04-06T18:32:47.652Z","avatar_url":"https://github.com/docwhat.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chronic\n\n\u003e A tool to hide `stdout` and `stderr` when a program runs successfully (i.e., returns exit code 0).\n\n[![GitHub Actions](https://github.com/docwhat/chronic/workflows/release/badge.svg)](https://github.com/docwhat/chronic/actions?workflow=release)\n[![GitHub release](https://img.shields.io/github/release/docwhat/chronic.svg)](https://github.com/docwhat/chronic/releases)\n[![Go Report Card](https://goreportcard.com/badge/github.com/docwhat/chronic)](https://goreportcard.com/report/github.com/docwhat/chronic)\n[![GitHub issues](https://img.shields.io/github/issues/docwhat/chronic.svg)](https://github.com/docwhat/chronic/issues)\n\n## About\n\nThis is a [go](https://golang.org/) based version of the classic `cronic` or `chronic` tool. [Chuck Houpt](http://habilis.net/chuck/) wrote the original [`chronic`](http://habilis.net/cronic/).\n\n## Usage\n\nIf you've ever used `cron` to run jobs, you know that it sends an email for any output generated by the command. This is why you see `crontabs` that look like this:\n\n```crontab\nMAILTO=admin@example.com\nPATH=/usr/bin:/bin\n0 4 0 0 0 my-noisy-command -vF \u003e/dev/null 2\u003e\u00261\n```\n\nThis is an anti-pattern:\n\n-   If you failed to get the command line correct, then you'll end up getting an email.\n-   If anything goes wrong, you've lost the output.\n-   If you log to a file, then you have to rotate that log, even if 99% of the contents are useless.\n\nWith `chronic` you don't have to worry about that anymore!\n\n```crontab\nMAILTO=admin@example.com\nPATH=/usr/bin:/bin\n0 4 0 0 0 chronic my-noisy-command -vF\n```\n\nNow, you'll get no emails unless `my-noisy-command` returns a non-zero exit code. If it does return a non-zero exit code, then you'll get an email that looks like this:\n\n```email\nTo: admin@example.com\nSubject: [CRON] chronic my-noisy-command -vF\n\n**** command ****\n[`bash` `-c` `echo \"boo\"; echo \"emergency\" 1\u003e\u00262; exit 10`]\n\n**** stdout ****\nstdout: Normal output from the noisy command.\nstdout: Starting messages\nstdout: Normal stuff\n\n**** stderr ****\nstderr: Standard error output from the noisy command.\nstderr:\nstderr: [FATAL] Something went wrong!\n\nExited with 10\n```\n\n## Installation\n\n### Download binaries\n\n#### Homebrew\n\n```sh\nbrew install docwhat/tap/chronic\n```\n\n#### GitHub Releases\n\nThe latest release is available on [`github.com/docwhat/chronic/releases`](https://github.com/docwhat/chronic/releases). You can download the binary for your architecture and OS there.\n\n#### Source\n\n```sh\ngo get docwhat.org/chronic\n```\n\n### Compile it yourself\n\nYou'll need to install a recent version of [Go](https://golang.org/) and set it up. You can check the `.travis.yml` file to see what version of go I'm using.\n\n```sh\ngo get -u docwhat.org/chronic\n```\n\n## Developers\n\nI love contributions! Read [CONTRIBUTING.md](CONTRIBUTING.md)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocwhat%2Fchronic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocwhat%2Fchronic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocwhat%2Fchronic/lists"}