Cron.NET
1.1.0
dotnet add package Cron.NET --version 1.1.0
NuGet\Install-Package Cron.NET -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cron.NET" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cron.NET --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Cron.NET, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Cron.NET as a Cake Addin
#addin nuget:?package=Cron.NET&version=1.1.0
// Install Cron.NET as a Cake Tool
#tool nuget:?package=Cron.NET&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CronNET
CronNET is a simple C# library for running tasks based on a cron schedule.
This repo is fork of original CronNET library, ported for work with dotnet 7
Cron Schedules
CronNET supports most cron scheduling. See tests for supported formats.
* * * * *
┬ ┬ ┬ ┬ ┬
│ │ │ │ │
│ │ │ │ │
│ │ │ │ └───── day of week (0 - 6) (Sunday=0 )
│ │ │ └────────── month (1 - 12)
│ │ └─────────────── day of month (1 - 31)
│ └──────────────────── hour (0 - 23)
└───────────────────────── min (0 - 59)
`* * * * *` Every minute.
`0 * * * *` Top of every hour.
`0,1,2 * * * *` Every hour at minutes 0, 1, and 2.
`*/2 * * * *` Every two minutes.
`1-55 * * * *` Every minute through the 55th minute.
`* 1,10,20 * * *` Every 1st, 10th, and 20th hours.
Examples
CronDaemon d = new CronDaemon();
d.AddJob("*/1 * * * *", () =>
{
Console.WriteLine(DateTime.Now.ToString());
});
d.Start();
// Wait and sleep forever. Let the cron daemon run.
await Task.Delay(Timeout.Infinite);
private void _myTask()
{
Console.WriteLine("Hello, world.")
}
d.AddJob(new CronJob("* * * * *", _myTask));
d.Start();
// Wait and sleep forever. Let the cron daemon run.
await Task.Delay(Timeout.Infinite);
// Stop daemon if you want to
d.Stop();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.