Skip to main content

Another YAML-based scheduler

Project description

Cronico

Cronico is a lightweight, YAML-based task scheduler for Unix-like systems.

It lets you define recurring jobs with flexible cron expressions — supporting traditional minute-based syntax, extended formats with seconds, and common shorthand aliases (@daily, @hourly, etc.).

Tasks can include:

  • Retry policies with configurable attempts.
  • Timeouts to kill long-running processes.
  • Environment injection from .env files or inline variables.
  • Working directory control per task.
  • Streaming or buffered logs for stdout/stderr.

Cronico is designed to run as a long-lived daemon (via systemd or similar) and can reload its configuration on SIGHUP without restarting the process.

tasks:
  example_task:
    description: |
      Classic cron expression: every 5 minutes
    cron: "*/5 * * * *"
    command: "echo 'Hello, World!'"
    retry_on_error: true
    max_attempts: 3
    env_file: ".env"
    timeout: 60  # seconds
    working_dir: "/path/to/dir"
    environment:
      MY_VAR: "value"

  custom_env:
    cron: "*/5 * * * *"
    environment:
      GREETING: "Hola"
    command: |
      echo "$GREETING from Bash at $(date)"

  every_minute_at_second_10:
    description: |
      Extended with seconds: every minute, at the 10th second
    cron:
      minute: "*"
      hour: "*"
      day: "*"
      month: "*"
      weekday: "*"
      second: 10
    command: "echo 'Run at second 10 of every minute'"

  every_30_seconds:
    description: |
      Classic with seconds: every 30 seconds
    cron: "*/1 * * * * 0,30"
    command: "echo 'This runs at second 0 and 30 of each minute'"

  daily_with_seconds:
    description: |
      Daily at 03:00:15
    cron:
      minute: 0
      hour: 3
      day: "*"
      month: "*"
      weekday: "*"
      second: 15
    command: "echo 'Daily at 03:00:15'"

  shorthand:
    description: |
      Shorthand: daily, at 00:00
    cron: "@daily"
    command: |
        echo "Supported aliases:"
        echo "- @yearly: 0 0 1 1 *"
        echo "- @annually: 0 0 1 1 *"
        echo "- @monthly: 0 0 1 * *"
        echo "- @weekly: 0 0 * * 0"
        echo "- @daily: 0 0 * * *"
        echo "- @midnight: 0 0 * * *"
        echo "- @hourly: 0 * * * *"

  with_shebang:
    description: |
      You can use a shebang to specify the interpreter to use.
    cron: "*/10 * * * *"
    command: |
      #!/usr/bin/env python3

      import datetime
      print("Hello from Python at", datetime.datetime.now())

  another_shebang_example:
    description: |
      Another one...
    cron: "*/10 * * * *"
    command: |
      #!/usr/bin/env perl

      use strict;
      use warnings;
      my ($sec,$min,$hour) = localtime();
      print "Hello from Perl at $hour:$min:$sec\n";

  and_another_shebang_example:
    description: |
      I think you get the idea.
    cron: "*/10 * * * *"
    command: |
      #!/usr/bin/env perl

      use strict;
      use warnings;
      my ($sec,$min,$hour) = localtime();
      print "Hello from Perl at $hour:$min:$sec\n";

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

cronico-0.9.12.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

cronico-0.9.12-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file cronico-0.9.12.tar.gz.

File metadata

  • Download URL: cronico-0.9.12.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for cronico-0.9.12.tar.gz
Algorithm Hash digest
SHA256 ec354dd69255457136483d9064b943587c5091d6130344ca884ddf78146f2f58
MD5 97c765e1c1b11c78f8f62c13f7daa132
BLAKE2b-256 9161b7e4e9329e3dc77ff2376f8ced1a31866c7f9758c9d5cf453a424f1c51eb

See more details on using hashes here.

File details

Details for the file cronico-0.9.12-py3-none-any.whl.

File metadata

  • Download URL: cronico-0.9.12-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for cronico-0.9.12-py3-none-any.whl
Algorithm Hash digest
SHA256 01f5e2808f0c3233a8a4f9a4dde616a1204c7e0fd8797e2d4ec3c7fca01f287c
MD5 b7230711aa19f6683250b361a487acde
BLAKE2b-256 1388b31a1b7ff666561c402e1ae4948f5f10a9b3510fd1bf04d84a7f2ccecb3a

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