{"id":31772137,"url":"https://github.com/focela/cronx21","last_synced_at":"2025-10-10T03:56:45.819Z","repository":{"id":314564772,"uuid":"1055955001","full_name":"focela/cronx21","owner":"focela","description":"Cronx is a Go-based scheduler for running shell commands on cron-style schedules.","archived":false,"fork":false,"pushed_at":"2025-10-04T16:18:40.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T17:50:28.541Z","etag":null,"topics":["command-execution","cron","golang","job-runner","scheduler","task-scheduler"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/focela.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-13T05:28:13.000Z","updated_at":"2025-10-05T16:40:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcfa9dad-f88b-4cbd-9e76-5a75e7ea33a7","html_url":"https://github.com/focela/cronx21","commit_stats":null,"previous_names":["focela/cronx"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/focela/cronx21","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focela%2Fcronx21","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focela%2Fcronx21/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focela%2Fcronx21/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focela%2Fcronx21/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/focela","download_url":"https://codeload.github.com/focela/cronx21/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focela%2Fcronx21/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002603,"owners_count":26083426,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["command-execution","cron","golang","job-runner","scheduler","task-scheduler"],"created_at":"2025-10-10T03:56:43.739Z","updated_at":"2025-10-10T03:56:45.812Z","avatar_url":"https://github.com/focela.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cronx\n\n[![Build Status](https://github.com/focela/cronx/workflows/Goreleaser/badge.svg)](https://github.com/focela/cronx/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/focela/cronx)](https://goreportcard.com/report/github.com/focela/cronx)\n[![Go Reference](https://pkg.go.dev/badge/github.com/focela/cronx?status.svg)](https://pkg.go.dev/github.com/focela/cronx?tab=doc)\n[![Release](https://img.shields.io/github/release/focela/cronx.svg?style=flat-square)](https://github.com/focela/cronx/releases)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA cron job scheduler written in Go that executes commands at specified intervals with signal handling.\n\n## Features\n\n- **Cron Expression Support**: Standard cron expressions with descriptor support (@daily, @weekly, etc.)\n- **Signal Handling**: Shutdown on SIGINT and SIGTERM signals\n- **Cross-Platform**: Runs on Linux, macOS, and Windows\n- **Command Execution**: Execute commands with arguments\n- **WaitGroup Synchronization**: Job synchronization to prevent race conditions\n- **Error Handling**: Return pattern with error logging\n\n## Installation\n\n### Pre-built Binaries\n\nDownload releases from [GitHub Releases](https://github.com/focela/cronx/releases):\n\n```bash\n# Linux\nwget https://github.com/focela/cronx/releases/latest/download/cronx_linux_amd64.tar.gz\ntar -xzf cronx_linux_amd64.tar.gz\nsudo mv cronx /usr/local/bin/\n\n# macOS\nwget https://github.com/focela/cronx/releases/latest/download/cronx_darwin_amd64.tar.gz\ntar -xzf cronx_darwin_amd64.tar.gz\nsudo mv cronx /usr/local/bin/\n\n# Windows\n# Download cronx_windows_amd64.zip and extract\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/focela/cronx.git\ncd cronx\ngo build -o cronx ./cronx.go\n```\n\n## Quick Start\n\n### Getting Cronx\n\nDownload the latest release from [GitHub Releases](https://github.com/focela/cronx/releases):\n\n```bash\n# Linux\nwget https://github.com/focela/cronx/releases/latest/download/cronx_linux_amd64.tar.gz\ntar -xzf cronx_linux_amd64.tar.gz\nsudo mv cronx /usr/local/bin/\n\n# macOS\nwget https://github.com/focela/cronx/releases/latest/download/cronx_darwin_amd64.tar.gz\ntar -xzf cronx_darwin_amd64.tar.gz\nsudo mv cronx /usr/local/bin/\n\n# Windows\n# Download cronx_windows_amd64.zip and extract\n```\n\n### Running Cronx\n\nA basic example:\n\n```bash\ncronx \"* * * * *\" echo \"Hello World\"\n```\n\nTo run the code, use the `go run` command, like:\n\n```sh\ngo run ./cronx.go \"* * * * *\" echo \"Test\"\n```\n\nThen you'll see the output every minute!\n\n### See more examples\n\n#### Examples\n\nA number of ready-to-run examples demonstrating various use cases of Cronx are available in the [Cronx examples](https://github.com/focela/cronx/tree/main/examples) repository.\n\n## Usage\n\n```bash\ncronx [schedule] [command] [args ...]\n```\n\n### Common Use Cases\n\n```bash\n# Database backups\ncronx \"0 2 * * *\" backup-database\n\n# Log rotation\ncronx \"@daily\" rotate-logs\n\n# Health checks\ncronx \"*/5 * * * *\" health-check\n\n# Data synchronization\ncronx \"0 */6 * * *\" sync-data\n\n# Cleanup tasks\ncronx \"@weekly\" cleanup-temp-files\n```\n\n### Cron Expression Format\n\n```\n┌───────────── minute (0 - 59)\n│ ┌───────────── hour (0 - 23)\n│ │ ┌───────────── day of month (1 - 31)\n│ │ │ ┌───────────── month (1 - 12)\n│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)\n│ │ │ │ │\n* * * * *\n```\n\n### Descriptors\n\n- `@yearly` or `@annually`: Run once a year\n- `@monthly`: Run once a month\n- `@weekly`: Run once a week\n- `@daily` or `@midnight`: Run once a day\n- `@hourly`: Run once an hour\n\n## Signal Handling\n\nCronx handles the following signals:\n\n- **SIGINT** (Ctrl+C): Stops the scheduler and waits for running jobs to complete\n- **SIGTERM**: Same as SIGINT, used for process termination\n\n## Development\n\n### Prerequisites\n\n- Go 1.25.1 or later\n- Git\n\n### Building\n\n```bash\ngit clone https://github.com/focela/cronx.git\ncd cronx\ngo build -o cronx ./cronx.go\n```\n\n### Testing\n\n```bash\n# Manual testing\ngo run ./cronx.go \"* * * * *\" echo \"Test\"\n\n# Note: Automated test suite will be developed in future releases\n```\n\n### Running\n\n```bash\ngo run ./cronx.go \"* * * * *\" echo \"Test\"\n```\n\n## Documentation\n\nSee the [API documentation on go.dev](https://pkg.go.dev/github.com/focela/cronx).\n\n## Dependencies\n\n- [robfig/cron/v3](https://github.com/robfig/cron) - Cron expression parsing and scheduling\n\n## License\n\nLicensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for details.\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to get started.\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test your changes manually\n5. Submit a pull request\n\nPlease also read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a list of changes.\n\n## Security\n\nFor security vulnerabilities, please email opensource@focela.com instead of using the issue tracker.\n\n## Support\n\nFor issues and questions, please use the [GitHub Issues](https://github.com/focela/cronx/issues) page.\n\n## Troubleshooting\n\n### Common Issues\n\n#### Command not found\n```bash\n# If you get \"command not found\" error\nexport PATH=$PATH:/usr/local/bin\n# or add to your shell profile (.bashrc, .zshrc, etc.)\necho 'export PATH=$PATH:/usr/local/bin' \u003e\u003e ~/.bashrc\n```\n\n#### Permission denied\n```bash\n# If you get permission denied when moving to /usr/local/bin\nsudo mv cronx /usr/local/bin/\n# or install to user directory\nmkdir -p ~/.local/bin\nmv cronx ~/.local/bin/\nexport PATH=$PATH:~/.local/bin\n```\n\n#### Invalid schedule error\n```bash\n# Check your cron expression format\n# Valid: \"0 9 * * 1\" (Monday at 9 AM)\n# Invalid: \"0 9 * * 8\" (day 8 doesn't exist)\n# Use cron expression validator online if needed\n```\n\n#### Signal handling issues\n```bash\n# If signals aren't handled properly, check:\n# 1. Process is running in foreground (not background with \u0026)\n# 2. Terminal supports signal forwarding\n# 3. No other signal handlers are interfering\n```\n\n### Debug Mode\n\nFor debugging, you can run with verbose output:\n\n```bash\n# Enable Go race detector\ngo run -race ./cronx.go \"* * * * *\" echo \"Test\"\n\n# Run with Go debug flags\nGODEBUG=gctrace=1 go run ./cronx.go \"* * * * *\" echo \"Test\"\n```\n\n### Getting Help\n\nIf you encounter issues not covered here:\n\n1. Check the [GitHub Issues](https://github.com/focela/cronx/issues)\n2. Search existing issues for similar problems\n3. Create a new issue with:\n   - OS and architecture\n   - Go version (`go version`)\n   - Cron expression used\n   - Error message or unexpected behavior\n   - Steps to reproduce\n\n## Roadmap\n\n- [ ] Configuration file support\n- [ ] Logging to file\n- [ ] Metrics collection\n- [ ] Health check endpoint\n- [ ] Docker image distribution\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocela%2Fcronx21","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffocela%2Fcronx21","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocela%2Fcronx21/lists"}