All Projects → jbernardo95 → cronex

jbernardo95 / cronex

Licence: MIT license
A cron like system built in Elixir, that you can mount in your supervision tree

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to cronex

mautic-cron-commands
Script to run Mautic commands from a web page.
Stars: ✭ 32 (-25.58%)
Mutual labels:  cron, cron-jobs
Healthchecks
A cron monitoring tool written in Python & Django
Stars: ✭ 4,297 (+9893.02%)
Mutual labels:  cron, cron-jobs
nodejs-cron-job-must-know
it is an example of running node.js script with every certain period(cron job)
Stars: ✭ 35 (-18.6%)
Mutual labels:  cron, cron-jobs
magento2-module-cron-schedule
A Magento2 visual cronjob overview for magento2 backend
Stars: ✭ 35 (-18.6%)
Mutual labels:  cron, cron-jobs
Cronscheduler.aspnetcore
Cron Scheduler for AspNetCore 2.x/3.x or DotNetCore 2.x/3.x Self-hosted
Stars: ✭ 100 (+132.56%)
Mutual labels:  cron, cron-jobs
mi-cron
📆 A microscopic parser for standard cron expressions.
Stars: ✭ 16 (-62.79%)
Mutual labels:  cron, cron-jobs
Wipe Modules
🗑️ Easily remove the node_modules folder of non-active projects
Stars: ✭ 304 (+606.98%)
Mutual labels:  cron, cron-jobs
Chronos
Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules
Stars: ✭ 4,303 (+9906.98%)
Mutual labels:  cron, cron-jobs
Laravel Totem
Manage Your Laravel Schedule From A Web Dashboard
Stars: ✭ 1,299 (+2920.93%)
Mutual labels:  cron, cron-jobs
Tiktok
Python web visualize build on the awesome web framework sanic
Stars: ✭ 55 (+27.91%)
Mutual labels:  cron, cron-jobs
EasyCronJob
This repository provides easy cron job to your application on IHostedService.
Stars: ✭ 66 (+53.49%)
Mutual labels:  cron, cron-jobs
Crontabmanager
PHP library for GNU/Linux cron jobs management.
Stars: ✭ 113 (+162.79%)
Mutual labels:  cron, cron-jobs
fastify-cron
Run cron jobs alongside your Fastify server 👷
Stars: ✭ 32 (-25.58%)
Mutual labels:  cron, cron-jobs
delayed-notifications-for-gravity-forms
Set delayed notifications for your gravity forms in easy steps
Stars: ✭ 26 (-39.53%)
Mutual labels:  cron
ansible-role-elasticsearch-curator
Ansible Role - Elasticsearch Curator
Stars: ✭ 31 (-27.91%)
Mutual labels:  cron
cronode
Cron for Node.js with expressive code
Stars: ✭ 15 (-65.12%)
Mutual labels:  cron
btrfs-backup
A simple, flexible script for versioned backups using btrfs and rsync
Stars: ✭ 59 (+37.21%)
Mutual labels:  cron
SwiftCron
SwiftCron is meant to make scheduling and repeating functions easy in Swift in macOS and Linux
Stars: ✭ 51 (+18.6%)
Mutual labels:  cron
dron
What if cron and systemd had a baby?
Stars: ✭ 30 (-30.23%)
Mutual labels:  cron
slacker
Simple smtp email server which redirects emails to slack.
Stars: ✭ 24 (-44.19%)
Mutual labels:  cron

Cronex

Travis Build

A cron like system, built in Elixir, that you can mount in your supervision tree.

Cronex's DSL for adding cron jobs is inspired by whenever Ruby gem.

Installation

Add cronex to your list of dependencies in mix.exs:

def deps do
  [{:cronex, "~> 0.4.0"}]
end

Then run mix deps.get to get the package.

Getting started

Cronex makes it really easy and intuitive to schedule cron like jobs.

You use the Cronex.Scheduler module to define a scheduler and add jobs to it.

Cronex will gather jobs from the scheduler you defined and will run them at the expected time.

# Somewhere in your application define your scheduler
defmodule MyApp.Scheduler do
  use Cronex.Scheduler

  every :hour do
    IO.puts "Every hour job"
  end

  every :day, at: "10:00" do
    IO.puts "Every day job at 10:00"
  end
end

# Start scheduler with start_link
MyApp.Scheduler.start_link

# Or add it to your supervision tree
defmodule MyApp.Supervisor do
  use Supervisor

  # ...

  def init(_opts) do
    children = [
      # ...
      supervisor(MyApp.Scheduler, [])
      # ...
    ]

    supervise(children, ...)
  end

  # ...
end

You can define as much schedulers as you want.

Testing

Cronex comes with Cronex.Test module which provides helpers to test your cron jobs.

defmodule MyApp.SchedulerTest do
  use ExUnit.Case
  use Cronex.Test

  test "every hour job is defined in MyApp.Scheduler" do
    assert_job_every :hour, in: MyApp.Scheduler 
  end

  test "every day job at 10:00 is defined in MyApp.Scheduler" do
    assert_job_every :day, at: "10:00", in: MyApp.Scheduler 
  end
end

Documentation

The project documentation can be found here.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jbernardo95/cronex.

License

Cronex source code is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].