All Projects → yisoft-dotnet → crontab

yisoft-dotnet / crontab

Licence: Apache-2.0 license
cron expression parser and executor for dotnet core.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to crontab

Chronos
Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules
Stars: ✭ 4,303 (+33000%)
Mutual labels:  cron, crontab, scheduled-jobs
php-cron-expr
Ultra lightweight, Dependency free and Super Fast Cron Expression parser for PHP
Stars: ✭ 42 (+223.08%)
Mutual labels:  cron, crontab, cron-expression
gronx
Lightweight, fast and dependency-free Cron expression parser (due checker), task scheduler and/or daemon for Golang (tested on v1.13 and above) and standalone usage
Stars: ✭ 206 (+1484.62%)
Mutual labels:  crontab, cron-expression, task-scheduler
Cronscheduler.aspnetcore
Cron Scheduler for AspNetCore 2.x/3.x or DotNetCore 2.x/3.x Self-hosted
Stars: ✭ 100 (+669.23%)
Mutual labels:  cron, scheduled-jobs, task-scheduler
Cronsun
A Distributed, Fault-Tolerant Cron-Style Job System.
Stars: ✭ 2,493 (+19076.92%)
Mutual labels:  cron, crontab
Cronv
A visualizer for CRONTAB
Stars: ✭ 196 (+1407.69%)
Mutual labels:  cron, crontab
Dkron
Dkron - Distributed, fault tolerant job scheduling system https://dkron.io
Stars: ✭ 2,930 (+22438.46%)
Mutual labels:  cron, scheduled-jobs
angular-cron-gen
A basic way to for users to graphically build a cron expression using Angular.
Stars: ✭ 36 (+176.92%)
Mutual labels:  cron, cron-expression
Node Cron
A simple cron-like job scheduler for Node.js
Stars: ✭ 2,064 (+15776.92%)
Mutual labels:  cron, scheduled-jobs
Shardingsphere Elasticjob Cloud
Stars: ✭ 248 (+1807.69%)
Mutual labels:  cron, scheduled-jobs
cron-validate
A cron-expression validator for TypeScript/JavaScript projects.
Stars: ✭ 40 (+207.69%)
Mutual labels:  cron, cron-expression
Cron Parser
Java Parser For Cron Expressions
Stars: ✭ 176 (+1253.85%)
Mutual labels:  cron, crontab
Crontab
Yii2 extension for crontab support
Stars: ✭ 170 (+1207.69%)
Mutual labels:  cron, crontab
Sundial
A Light-weight Job Scheduling Framework
Stars: ✭ 230 (+1669.23%)
Mutual labels:  cron, scheduled-jobs
Quantum Core
⌚ Cron-like job scheduler for Elixir
Stars: ✭ 1,905 (+14553.85%)
Mutual labels:  cron, crontab
croncpp
A C++11/14/17 header-only cross-platform library for handling CRON expressions
Stars: ✭ 162 (+1146.15%)
Mutual labels:  cron, cron-expression
point-vue-cron
vue component: cron expression generator
Stars: ✭ 21 (+61.54%)
Mutual labels:  cron, cron-expression
croner
Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environments.
Stars: ✭ 169 (+1200%)
Mutual labels:  cron, crontab
node-cron-expression
Declarative functional cron expression builder
Stars: ✭ 17 (+30.77%)
Mutual labels:  cron, crontab
cron-time
Javascript Cron Time Expressions
Stars: ✭ 58 (+346.15%)
Mutual labels:  cron, cron-expression

Yisoft.Crontab

Build status NuGet

cron expression parser and executor for dotnet core.

this project based on NCrontab-Advanced.

If you have any problems, make sure to file an issue here on Github.

Crontab task executor

CronAttribute

This library support annotation method only. if you want create a crontab task, simply add the CronAttribute on some method.

We also provide some advanced features that you can get by adding some parameters to the method to get the information associated with the current task.

Here are some samples:

public class TestScheduler
{
	[Cron("18/1 * * * * ? *", CronStringFormat.WithSecondsAndYears)]
	public static void Task1()
	{
		Debug.WriteLine($"Task..............1111_{DateTime.Now}");
	}

	[Cron("28/1 * * * * ? *", CronStringFormat.WithSecondsAndYears)]
	public static void Task2(DateTime time, CrontabTask task)
	{
		Debug.WriteLine($"Task..............2222_{time}_{task.Method.Name}");
	}

	[Cron("28/1 * * * * ? *", CronStringFormat.WithSecondsAndYears)]
	public static void Task3(DateTime time, CrontabTask task)
	{
		Debug.WriteLine($"Task..............3333_{time}_{task.Method.Name}");
	}

	[Cron("1-8 * * * * ? *", CronStringFormat.WithSecondsAndYears)]
	[Cron("48/1 * * * * ? *", CronStringFormat.WithSecondsAndYears)]
	public static void Task4(DateTime time, CrontabTask task, CrontabTaskExecutor taskExecutor)
	{
		Debug.WriteLine($"Task..............Cron_{time}_{task.Method.Name}_{taskExecutor.Tasks.Count}");
	}

	// this task will begin execution after 100 seconds of startup
	[Cron("0/1 * * * * *", 100, CronStringFormat.WithSeconds)]
	public static void DeferTask1()
	{
		Debug.WriteLine($"Task..............5555_{DateTime.Now}");
	}
}

Constructor

The CrontabTaskExecutor class contains a constructor that with one parameter, the parameter is Func<MethodInfo, object> typeInstanceCreator. typeInstanceCreator used to create an object instance where the task method is definded. this will be very useful!

In console application, you can initialize an instance of an object with the new keyword or reflection. and in web application, you can use DI(dependency injection) directly.

For better use this library in your Web application, see the Yisoft.AspNetCore.Crontab project.

Support for the following cron expressions

Field name   | Allowed values  | Allowed special characters
------------------------------------------------------------
Minutes      | 0-59            | * , - /
Hours        | 0-23            | * , - /
Day of month | 1-31            | * , - / ? L W
Month        | 1-12 or JAN-DEC | * , - /
Day of week  | 0-6 or SUN-SAT  | * , - / ? L #
Year         | 0001–9999       | * , - /

Related community projects

License

Released under the Apache 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].