{"id":39291201,"url":"https://github.com/wachawo/checkcrontab","last_synced_at":"2026-01-18T01:18:07.970Z","repository":{"id":311189133,"uuid":"1042694035","full_name":"wachawo/checkcrontab","owner":"wachawo","description":"A Python script for checking syntax of crontab files.","archived":false,"fork":false,"pushed_at":"2026-01-01T15:58:52.000Z","size":169,"stargazers_count":45,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T22:56:31.871Z","etag":null,"topics":["checker","cron","crontab","syntax","systems-administration","utilities","validation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/checkcrontab/","language":"Python","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/wachawo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["wachawo"]}},"created_at":"2025-08-22T12:27:22.000Z","updated_at":"2026-01-12T22:26:52.000Z","dependencies_parsed_at":"2025-08-22T18:53:20.463Z","dependency_job_id":"3f931e04-41a8-4755-a6ea-65abf41935dd","html_url":"https://github.com/wachawo/checkcrontab","commit_stats":null,"previous_names":["wachawo/checkcrontab"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/wachawo/checkcrontab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachawo%2Fcheckcrontab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachawo%2Fcheckcrontab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachawo%2Fcheckcrontab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachawo%2Fcheckcrontab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wachawo","download_url":"https://codeload.github.com/wachawo/checkcrontab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachawo%2Fcheckcrontab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"ssl_error","status_checked_at":"2026-01-18T00:39:39.467Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["checker","cron","crontab","syntax","systems-administration","utilities","validation"],"created_at":"2026-01-18T01:18:07.901Z","updated_at":"2026-01-18T01:18:07.961Z","avatar_url":"https://github.com/wachawo.png","language":"Python","funding_links":["https://github.com/sponsors/wachawo"],"categories":["Python"],"sub_categories":[],"readme":"## Checkcrontab - check syntax in crontab files\n\n[![CI](https://github.com/wachawo/checkcrontab/actions/workflows/ci.yml/badge.svg)](https://github.com/wachawo/checkcrontab/actions/workflows/ci.yml)\n[![Coverage](https://codecov.io/gh/wachawo/checkcrontab/branch/main/graph/badge.svg)](https://codecov.io/gh/wachawo/checkcrontab?branch=main)\n[![PyPI](https://img.shields.io/pypi/v/checkcrontab.svg)](https://pypi.org/project/checkcrontab/)\n[![Downloads](https://img.shields.io/pypi/dm/checkcrontab.svg)](https://pypi.org/project/checkcrontab/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/wachawo/checkcrontab/blob/main/LICENSE)\n[![Python](https://img.shields.io/pypi/pyversions/checkcrontab.svg)](https://pypi.org/project/checkcrontab/)\n\nA Python script for checking syntax of crontab files. Cross-platform support for Linux, macOS, and Windows.\n\n**[English](https://github.com/wachawo/checkcrontab/blob/main/README.md)** | [Español](https://github.com/wachawo/checkcrontab/blob/main/docs/README_ES.md) | [Português](https://github.com/wachawo/checkcrontab/blob/main/docs/README_PT.md) | [Français](https://github.com/wachawo/checkcrontab/blob/main/docs/README_FR.md) | [Deutsch](https://github.com/wachawo/checkcrontab/blob/main/docs/README_DE.md) | [Italiano](https://github.com/wachawo/checkcrontab/blob/main/docs/README_IT.md) | [Русский](https://github.com/wachawo/checkcrontab/blob/main/docs/README_RU.md) | [中文](https://github.com/wachawo/checkcrontab/blob/main/docs/README_ZH.md) | [日本語](https://github.com/wachawo/checkcrontab/blob/main/docs/README_JA.md) | [हिन्दी](https://github.com/wachawo/checkcrontab/blob/main/docs/README_HI.md) | [한국어](https://github.com/wachawo/checkcrontab/blob/main/docs/README_KR.md)\n\n\u003cimg width=\"1108\" height=\"257\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9ad75b94-3a72-4d0f-b9f4-9e1b22ac475d\" /\u003e\n\n### Requirements\n\n- **Python 3.7 or higher**\n- **Linux**: Linux system with systemctl (for daemon checks), read access to `/etc/crontab`\n- **macOS**: Unix system with read access to `/etc/crontab` (systemctl not available)\n- **Windows**: No additional requirements (file-based validation only)\n\n### Platform Support\n\n**Linux (Full Support):**\n- ✅ System crontab validation (`/etc/crontab`)\n- ✅ User crontab validation (via `crontab -l -u username`)\n- ✅ User existence validation\n- ✅ Daemon/service checks via systemctl\n- ✅ All crontab syntax features\n- ✅ File permissions validation\n- ✅ Cron daemon status checks\n\n**macOS (Partial Support):**\n- ✅ System crontab validation (`/etc/crontab`)\n- ✅ User crontab validation (via `crontab -l -u username`)\n- ✅ User existence validation\n- ❌ Daemon/service checks (systemctl not available)\n- ✅ All crontab syntax features\n- ✅ File permissions validation\n- ❌ Cron daemon status checks\n\n**Windows (Limited Support):**\n- ✅ File-based crontab syntax validation\n- ❌ User existence checks (no user management integration)\n- ❌ System crontab access (no `/etc/crontab`)\n- ❌ Daemon/service checks (no systemctl)\n- ✅ All crontab syntax features supported\n- ❌ File permissions validation (no Unix permissions)\n- ❌ Cron daemon status checks (no cron daemon)\n\n### Installation\n\n```bash\npip3 install checkcrontab\n```\n\nOr from GitHub:\n\n```bash\npip3 install git+https://github.com/wachawo/checkcrontab.git\n```\n\n### Usage\n\n```bash\n# Check system crontab (Linux/macOS only)\ncheckcrontab\n\n# Check crontab file\ncheckcrontab /etc/crontab\n\n# Check user crontab (Linux/macOS only)\ncheckcrontab username\n\n# Check with explicit type flags\ncheckcrontab -S system.cron -U user.cron -u username1 -u username2\n\n# Check crontab directory\ncheckcrontab /etc/cron.d\n\n# Show help\ncheckcrontab --help\n\n# Show version\ncheckcrontab --version\n```\n\n**Platform-specific behavior:**\n- **Linux**: Full functionality including daemon checks and user validation\n- **macOS**: Full functionality except daemon checks (systemctl not available)\n- **Windows**: File-based validation only, no system integration\n\n### TEXT Output\nTo redirect output from STDERR to STDOUT (for example, in CI), use --format text:\n\n```bash\ncheckcrontab --format text examples/user_valid.txt\n```\n\n#### SARIF Output\nFor SARIF output, use the `--format sarif` flag:\n\n```bash\ncheckcrontab --format sarif examples/user_valid.txt\n```\n\n### JSON Output\nFor machine-readable output, use the `--format json` flag:\n\n```bash\ncheckcrontab --format json examples/user_valid.txt\n```\n\nExample JSON output:\n\n```json\n{\n  \"success\": true,\n  \"total_files\": 2,\n  \"total_rows\": 27,\n  \"total_rows_errors\": 0,\n  \"total_errors\": 0,\n  \"files\": [\n    {\n      \"file\": \"/etc/crontab\",\n      \"is_system_crontab\": true,\n      \"rows\": 5,\n      \"rows_errors\": 0,\n      \"errors_count\": 0,\n      \"errors\": [],\n      \"success\": true\n    },\n    {\n      \"file\": \"examples/user_valid.txt\",\n      \"is_system_crontab\": false,\n      \"rows\": 22,\n      \"rows_errors\": 0,\n      \"errors_count\": 0,\n      \"errors\": [],\n      \"success\": true\n    }\n  ]\n}\n```\n\n### Exit codes\n\n| Code | Meaning |\n|------|---------|\n| 0    | No errors (warnings allowed). With `--exit-zero` always 0. |\n| 1    | Findings present: any error, or any warning when `--strict` is set. |\n| 2    | Runtime/usage error (unexpected failure, bad CLI args, etc.). |\n\n### Command Line Options\n\n- `-S, --system` - System crontab files\n- `-U, --user` - User crontab files\n- `-u, --username` - Usernames to check\n- `-v, --version` - Show version\n- `-d, --debug` - Debug output\n- `-n, --no-colors` - Disable colored output\n- `--format {text,json,sarif}` - Output format\n- `--strict` - Treat warnings as errors\n- `--exit-zero` - Always return exit code 0\n\n### Features\n\n- **Cross-platform syntax validation** (Linux, macOS, Windows)\n- **Platform-specific features:**\n  - **Linux/macOS**: System and user crontab validation, user existence checks, daemon validation\n  - **Windows**: File-based validation only\n- **Time field validation** (minutes, hours, days, months, weekdays)\n- **Dangerous command detection**\n- **Special keyword support** (@reboot, @daily, etc.)\n- **Multi-line command support**\n\n**[Features Documentation](https://github.com/wachawo/checkcrontab/blob/main/docs/FEATURES.md)** - Comprehensive guide to supported syntax, valid values, examples, and error messages.\n\n### Development Tools\n\n```bash\npip3 install pre-commit flake8 pytest mypy ruff\npre-commit install\npre-commit run --all-files\npre-commit autoupdate\n```\n\n### Testing\n\n```bash\npytest --cov=checkcrontab --cov-report=term-missing --cov-report=xml\ncoverage report\n# CI automatically uploads coverage.xml to Codecov\n# python -m coverage_badge -o docs/coverage.svg\n```\n\n### Usage with pre-commit\n\nYou can use checkcrontab as a pre-commit hook in your projects:\n\n1. Add to your `.pre-commit-config.yaml`:\n\n```yaml\nrepos:\n  - repo: https://github.com/wachawo/checkcrontab\n    rev: 0.0.8  # Use the latest version\n    hooks:\n      - id: checkcrontab\n        files: \\.(cron|crontab|tab|conf)$\n        exclude: (\\.git|node_modules|__pycache__)/\n        args: [--format, json, --strict]\n```\n\n2. Install pre-commit:\n\n```bash\npip install pre-commit\npre-commit install\n```\n\n3. The hook will automatically check all `.cron`, `.crontab`, and `.tab` files in your repository.\n\n### License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwachawo%2Fcheckcrontab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwachawo%2Fcheckcrontab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwachawo%2Fcheckcrontab/lists"}