Skip to main content

Container cron with seconds resolution

Project description

pre-commit Run the test suite

pytocron

pytocron is a cron implementation targeting containers, written in Python, with seconds and year resolution, native support for Healthchecks.io and >90% test coverage. It is licensed under GNU Affero General Public License v3.0 or later and is meant to remain simple and maintainable.

One particular prime use case is to feed uptime monitoring. For example, here is how I monitor availability of my blog:

# Check blog availability every 30 seconds
# hc-ping: https://hc-ping.com/00000000-0000-0000-0000-000000000000
*/30 * * * * * * wget -qO- -T2 https://blog.hartwork.org/ | grep -qF 'Hartwork Blog'

Regarding name "pytocron": It was inspired by the term pytosquatting and it had no search results on Google.

If you like pytocron, please support it with a star!

Installation

# pip3 install pytocron

or

# pipx install pytocron

Comparison with other crons

  pytocron Supercronic Vixie Cron
Written in Python Go C
Container support      
∟ Targets containers containers non-container systems
∟ Environment variables kept kept ?
∟ Multi-user mode
∟ Logging target stdout, stderr stdout, stderr syslog or log file
∟ Log rotation support
∟ Command shell bash -e -u /bin/sh /bin/sh
∟ Daemonization
∟ Crontab reloading
Integrations      
∟ Support for Healthchecks.io
∟ Support for Sentry
Crontab syntax      
∟ Seconds and year resolution ✔ (forced) ✔ (optional)
∟ Implementation croniter cronexpr custom
Exceeded job runtime handling auto-kill overlapping or skips ?
Handling of daylight saving time ? ? ?
Signal handling      
SIGHUP shutdown shutdown log file reopen
SIGUSR2 shutdown crontab file reload shutdown

Contributing

Prior to opening pull requests, please create an issue to discuss the matter first. Thank you!

Security

If you believ to have found a security issue within pytocron, please reach out via e-mail. Thank you!

Support

Please report any bugs that you find.

Like this tool? Support it with a star!

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

pytocron-1.2.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

pytocron-1.2.0-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file pytocron-1.2.0.tar.gz.

File metadata

  • Download URL: pytocron-1.2.0.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pytocron-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8a5e386638f870cd52426457618f1674f1fae78494fa780997b5de192d7edc9d
MD5 e601e479b4c52ca50f29d3f2e02344a8
BLAKE2b-256 4bd8567eb2f372210ad360a7e6af3ac2196de7d3dc5031f525b1f0686eecbad3

See more details on using hashes here.

File details

Details for the file pytocron-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pytocron-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pytocron-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 792de8401c7c10d8d2006d53f568b7b32bd6ebd76059c2bd91af43c9c4a78bfd
MD5 cfc7e3ef4dbf734f793129d0ec8b2af8
BLAKE2b-256 587a25e32726d8df7d0991648fe329921e7064d225b03a9d8fc598b0648ce947

See more details on using hashes here.

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