Skip to main content

A Python3 script for checking syntax and correctness of crontab files

Project description

Checkcrontab - check syntax in crontab files

CI PyPI Python

A Python script for checking syntax of crontab files. Cross-platform support for Linux, macOS, and Windows.

English | Español | Português | Français | Deutsch | Italiano | Русский | 中文 | 日本語 | हिन्दी

Requirements

  • Python 3.7 or higher
  • Linux/Unix system with systemctl (for daemon checks)
  • Read access to /etc/crontab (on Linux)

Installation

pip3 install checkcrontab

Or from GitHub:

pip3 install git+https://github.com/wachawo/checkcrontab.git

Usage

# Check system crontab (Linux only)
checkcrontab

# Check crontab file
checkcrontab /path/to/crontab

# Check user crontab
checkcrontab username

# Check with explicit type flags
checkcrontab -S system.cron -U user.cron -u username1 -u username2

# Show help
checkcrontab --help

# Show version
checkcrontab --version

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

Features

  • Cross-platform support (Linux, macOS, Windows)
  • System and user crontab validation
  • Time field validation (minutes, hours, days, months, weekdays)
  • User existence validation (Linux/macOS)
  • Dangerous command detection
  • Special keyword support (@reboot, @daily, etc.)
  • Multi-line command support

📖 Detailed Features Documentation - Comprehensive guide to supported syntax, valid values, examples, and error messages.

Development Tools

pip3 install pre-commit flake8 pytest mypy ruff
pre-commit install
pre-commit run --all-files
pre-commit autoupdate

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkcrontab-0.0.6.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

checkcrontab-0.0.6-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file checkcrontab-0.0.6.tar.gz.

File metadata

  • Download URL: checkcrontab-0.0.6.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for checkcrontab-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c69d5d32f06e4934e56789e869909e93c20d754cdbc1bb81a3516a9fab4d12b6
MD5 cae616e18f1d9baa5d187623fb9d3917
BLAKE2b-256 d6c64d51f454123405d137c8d6402d17b39327a4c567b0900ed97c6c2d85a799

See more details on using hashes here.

Provenance

The following attestation bundles were made for checkcrontab-0.0.6.tar.gz:

Publisher: publish.yml on wachawo/checkcrontab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file checkcrontab-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: checkcrontab-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for checkcrontab-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed3badf63e645ce4aa6fae46a77a7da4e6cb4a6078a780d451efa156356c197
MD5 1765489966ee4dc7b881e71f4d5c7078
BLAKE2b-256 0bc0af1fe7aec6630df0567fe35d375e76be8c075444fc09ec4ca40d0f748ebf

See more details on using hashes here.

Provenance

The following attestation bundles were made for checkcrontab-0.0.6-py3-none-any.whl:

Publisher: publish.yml on wachawo/checkcrontab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page