| Name | checkcrontab JSON | 
            
| Version | 
                  0.0.12
                   
                  JSON | 
            
 | download  | 
            
| home_page | None  | 
            
| Summary | A Python3 script for checking syntax and correctness of crontab files | 
            | upload_time | 2025-10-18 23:12:31 | 
            | maintainer | None | 
            
            | docs_url | None | 
            | author | None | 
            
            | requires_python | >=3.7 | 
            
            
            | license | MIT License
        
        Copyright (c) 2014 Aleksandr Pimenov (wachawo@gmail.com)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
         | 
            | keywords | 
                
                    crontab
                
                     cron
                
                     validation
                
                     syntax
                
                     checker
                
                     system
                
                     administration
                 | 
            | VCS | 
                
                     | 
                
            
            | bugtrack_url | 
                
                 | 
             
            
            | requirements | 
                
                  No requirements were recorded.
                
             | 
            
| Travis-CI | 
                
                   No Travis.
                
             | 
            | coveralls test coverage | 
                
                     
                
             | 
        
        
            
            ## Checkcrontab - check syntax in crontab files
[](https://github.com/wachawo/checkcrontab/actions/workflows/ci.yml)
[](https://codecov.io/gh/wachawo/checkcrontab?branch=main)
[](https://pypi.org/project/checkcrontab/)
[](https://pypi.org/project/checkcrontab/)
[](https://github.com/wachawo/checkcrontab/blob/main/LICENSE)
[](https://pypi.org/project/checkcrontab/)
A Python script for checking syntax of crontab files. Cross-platform support for Linux, macOS, and Windows.
**[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)
### Requirements
- **Python 3.7 or higher**
- **Linux**: Linux system with systemctl (for daemon checks), read access to `/etc/crontab`
- **macOS**: Unix system with read access to `/etc/crontab` (systemctl not available)
- **Windows**: No additional requirements (file-based validation only)
### Platform Support
**Linux (Full Support):**
- ✅ System crontab validation (`/etc/crontab`)
- ✅ User crontab validation (via `crontab -l -u username`)
- ✅ User existence validation
- ✅ Daemon/service checks via systemctl
- ✅ All crontab syntax features
- ✅ File permissions validation
- ✅ Cron daemon status checks
**macOS (Partial Support):**
- ✅ System crontab validation (`/etc/crontab`)
- ✅ User crontab validation (via `crontab -l -u username`)
- ✅ User existence validation
- ❌ Daemon/service checks (systemctl not available)
- ✅ All crontab syntax features
- ✅ File permissions validation
- ❌ Cron daemon status checks
**Windows (Limited Support):**
- ✅ File-based crontab syntax validation
- ❌ User existence checks (no user management integration)
- ❌ System crontab access (no `/etc/crontab`)
- ❌ Daemon/service checks (no systemctl)
- ✅ All crontab syntax features supported
- ❌ File permissions validation (no Unix permissions)
- ❌ Cron daemon status checks (no cron daemon)
### Installation
```bash
pip3 install checkcrontab
```
Or from GitHub:
```bash
pip3 install git+https://github.com/wachawo/checkcrontab.git
```
### Usage
```bash
# Check system crontab (Linux/macOS only)
checkcrontab
# Check crontab file
checkcrontab /etc/crontab
# Check user crontab (Linux/macOS only)
checkcrontab username
# Check with explicit type flags
checkcrontab -S system.cron -U user.cron -u username1 -u username2
# Check crontab directory
checkcrontab /etc/cron.d
# Show help
checkcrontab --help
# Show version
checkcrontab --version
```
**Platform-specific behavior:**
- **Linux**: Full functionality including daemon checks and user validation
- **macOS**: Full functionality except daemon checks (systemctl not available)
- **Windows**: File-based validation only, no system integration
### TEXT Output
To redirect output from STDERR to STDOUT (for example, in CI), use --format text:
```bash
checkcrontab --format text examples/user_valid.txt
```
#### SARIF Output
For SARIF output, use the `--format sarif` flag:
```bash
checkcrontab --format sarif examples/user_valid.txt
```
### JSON Output
For machine-readable output, use the `--format json` flag:
```bash
checkcrontab --format json examples/user_valid.txt
```
Example JSON output:
```json
{
  "success": true,
  "total_files": 2,
  "total_rows": 27,
  "total_rows_errors": 0,
  "total_errors": 0,
  "files": [
    {
      "file": "/etc/crontab",
      "is_system_crontab": true,
      "rows": 5,
      "rows_errors": 0,
      "errors_count": 0,
      "errors": [],
      "success": true
    },
    {
      "file": "examples/user_valid.txt",
      "is_system_crontab": false,
      "rows": 22,
      "rows_errors": 0,
      "errors_count": 0,
      "errors": [],
      "success": true
    }
  ]
}
```
### Exit codes
| Code | Meaning |
|------|---------|
| 0    | No errors (warnings allowed). With `--exit-zero` always 0. |
| 1    | Findings present: any error, or any warning when `--strict` is set. |
| 2    | Runtime/usage error (unexpected failure, bad CLI args, etc.). |
### Command Line Options
- `-S, --system` - System crontab files
- `-U, --user` - User crontab files
- `-u, --username` - Usernames to check
- `-v, --version` - Show version
- `-d, --debug` - Debug output
- `-n, --no-colors` - Disable colored output
- `--format {text,json,sarif}` - Output format
- `--strict` - Treat warnings as errors
- `--exit-zero` - Always return exit code 0
### Features
- **Cross-platform syntax validation** (Linux, macOS, Windows)
- **Platform-specific features:**
  - **Linux/macOS**: System and user crontab validation, user existence checks, daemon validation
  - **Windows**: File-based validation only
- **Time field validation** (minutes, hours, days, months, weekdays)
- **Dangerous command detection**
- **Special keyword support** (@reboot, @daily, etc.)
- **Multi-line command support**
**[Features Documentation](https://github.com/wachawo/checkcrontab/blob/main/docs/FEATURES.md)** - Comprehensive guide to supported syntax, valid values, examples, and error messages.
### Development Tools
```bash
pip3 install pre-commit flake8 pytest mypy ruff
pre-commit install
pre-commit run --all-files
pre-commit autoupdate
```
### Testing
```bash
pytest --cov=checkcrontab --cov-report=term-missing
coverage html  # optional local HTML report in htmlcov/index.html
# CI automatically uploads coverage.xml to Codecov
# python -m coverage_badge -o docs/coverage.svg
```
### Usage with pre-commit
You can use checkcrontab as a pre-commit hook in your projects:
1. Add to your `.pre-commit-config.yaml`:
```yaml
repos:
  - repo: https://github.com/wachawo/checkcrontab
    rev: 0.0.8  # Use the latest version
    hooks:
      - id: checkcrontab
        files: \.(cron|crontab|tab|conf)$
        exclude: (\.git|node_modules|__pycache__)/
        args: [--format, json, --strict]
```
2. Install pre-commit:
```bash
pip install pre-commit
pre-commit install
```
3. The hook will automatically check all `.cron`, `.crontab`, and `.tab` files in your repository.
### License
MIT License
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": null,
    "name": "checkcrontab",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Aleksandr Pimenov <wachawo@gmail.com>",
    "keywords": "crontab, cron, validation, syntax, checker, system, administration",
    "author": null,
    "author_email": "Aleksandr Pimenov <wachawo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/78/9e/6c771e26bf6aee32046ab546fcdcc3e48f1253ad918b6e6f08d8f0fd675e/checkcrontab-0.0.12.tar.gz",
    "platform": null,
    "description": "## Checkcrontab - check syntax in crontab files\n\n[](https://github.com/wachawo/checkcrontab/actions/workflows/ci.yml)\n[](https://codecov.io/gh/wachawo/checkcrontab?branch=main)\n[](https://pypi.org/project/checkcrontab/)\n[](https://pypi.org/project/checkcrontab/)\n[](https://github.com/wachawo/checkcrontab/blob/main/LICENSE)\n[](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\u00f1ol](https://github.com/wachawo/checkcrontab/blob/main/docs/README_ES.md) | [Portugu\u00eas](https://github.com/wachawo/checkcrontab/blob/main/docs/README_PT.md) | [Fran\u00e7ais](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) | [\u0420\u0443\u0441\u0441\u043a\u0438\u0439](https://github.com/wachawo/checkcrontab/blob/main/docs/README_RU.md) | [\u4e2d\u6587](https://github.com/wachawo/checkcrontab/blob/main/docs/README_ZH.md) | [\u65e5\u672c\u8a9e](https://github.com/wachawo/checkcrontab/blob/main/docs/README_JA.md) | [\u0939\u093f\u0928\u094d\u0926\u0940](https://github.com/wachawo/checkcrontab/blob/main/docs/README_HI.md)\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- \u2705 System crontab validation (`/etc/crontab`)\n- \u2705 User crontab validation (via `crontab -l -u username`)\n- \u2705 User existence validation\n- \u2705 Daemon/service checks via systemctl\n- \u2705 All crontab syntax features\n- \u2705 File permissions validation\n- \u2705 Cron daemon status checks\n\n**macOS (Partial Support):**\n- \u2705 System crontab validation (`/etc/crontab`)\n- \u2705 User crontab validation (via `crontab -l -u username`)\n- \u2705 User existence validation\n- \u274c Daemon/service checks (systemctl not available)\n- \u2705 All crontab syntax features\n- \u2705 File permissions validation\n- \u274c Cron daemon status checks\n\n**Windows (Limited Support):**\n- \u2705 File-based crontab syntax validation\n- \u274c User existence checks (no user management integration)\n- \u274c System crontab access (no `/etc/crontab`)\n- \u274c Daemon/service checks (no systemctl)\n- \u2705 All crontab syntax features supported\n- \u274c File permissions validation (no Unix permissions)\n- \u274c 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\ncoverage html  # optional local HTML report in htmlcov/index.html\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",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2014 Aleksandr Pimenov (wachawo@gmail.com)\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A Python3 script for checking syntax and correctness of crontab files",
    "version": "0.0.12",
    "project_urls": {
        "Bug Reports": "https://github.com/wachawo/checkcrontab/issues",
        "Documentation": "https://github.com/wachawo/checkcrontab#readme",
        "Homepage": "https://github.com/wachawo/checkcrontab",
        "Repository": "https://github.com/wachawo/checkcrontab"
    },
    "split_keywords": [
        "crontab",
        " cron",
        " validation",
        " syntax",
        " checker",
        " system",
        " administration"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d9c84a5490363fc02cee1e8d65eacc8f06889513d36339c44d777d8de23ad0a0",
                "md5": "c0c440079bbe01d29227dcb38d8d2664",
                "sha256": "9b7c526465a30bbe36a8880a4cd7b1a09c1314032fa67745dd6679bd4e4cb682"
            },
            "downloads": -1,
            "filename": "checkcrontab-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c0c440079bbe01d29227dcb38d8d2664",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 18640,
            "upload_time": "2025-10-18T23:12:29",
            "upload_time_iso_8601": "2025-10-18T23:12:29.620583Z",
            "url": "https://files.pythonhosted.org/packages/d9/c8/4a5490363fc02cee1e8d65eacc8f06889513d36339c44d777d8de23ad0a0/checkcrontab-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "789e6c771e26bf6aee32046ab546fcdcc3e48f1253ad918b6e6f08d8f0fd675e",
                "md5": "ce1d72f544350fce7227fcb7eea90dd0",
                "sha256": "ac11d55e7db1620e2086f2869602f973b452ffd223670eae017e4da7d1c738d0"
            },
            "downloads": -1,
            "filename": "checkcrontab-0.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "ce1d72f544350fce7227fcb7eea90dd0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 34696,
            "upload_time": "2025-10-18T23:12:31",
            "upload_time_iso_8601": "2025-10-18T23:12:31.055450Z",
            "url": "https://files.pythonhosted.org/packages/78/9e/6c771e26bf6aee32046ab546fcdcc3e48f1253ad918b6e6f08d8f0fd675e/checkcrontab-0.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-18 23:12:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wachawo",
    "github_project": "checkcrontab",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "checkcrontab"
}