A robust, lightweight job scheduling framework for .NET applications. Schedule and run tasks at specific intervals or times with full cross-platform support.
$ dotnet add package DemiCode.SchedulingA robust, lightweight job scheduling framework for .NET applications. Schedule and run tasks at specific intervals or times with full cross-platform support.
dotnet add package DemiCode.Scheduling
For log4net integration:
dotnet add package DemiCode.Logging.log4net
using DemiCode.Scheduling;
using DemiCode.Scheduling.Schedules;
using DemiCode.Scheduling.Tasks;
// Create a scheduler
var scheduler = new Scheduler();
// Create a task
var task = new ApplicationTask("notepad.exe");
// Create a schedule (run every 5 minutes)
var schedule = new IntervalSchedule(TimeSpan.FromMinutes(5));
// Create and add a job
var job = new Job("MyJob", task, schedule);
scheduler.Jobs.Add(job);
// Start the scheduler
scheduler.Start();
// Stop when done
scheduler.Stop();
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="scheduler" type="DemiCode.Scheduling.SchedulerSection, DemiCode.Scheduling"/>
</configSections>
<scheduler>
<job name="Backup" type="DemiCode.Scheduling.Job">
<task type="DemiCode.Scheduling.Tasks.ApplicationTask">
<constructor>
<parameter type="System.String">backup.exe</parameter>
</constructor>
</task>
<schedule type="DemiCode.Scheduling.Schedules.DailySchedule">
<constructor>
<parameter type="System.TimeSpan">02:00:00</parameter>
</constructor>
</schedule>
</job>
</scheduler>
</configuration>
DemiCode.Logging namespaceusing DemiCode.Logging.Loggers; → using DemiCode.Logging;new ApplicationTask("cmd.exe", "/c", "your command")new ApplicationTask("/bin/sh", "-c", "your command")For complete documentation, examples, and migration guides, visit: https://github.com/KodeCompagniet/demicode-scheduling
This project is licensed under the MIT License - see the LICENSE file for details.