Noundry.Jobs

Comprehensive job scheduling solution with a library for database, file, HTTP/API, and email operations, plus a CLI tool for creating and managing scheduled jobs across Windows, Linux, and macOS.

Complete Job Automation Solution

Two powerful packages that work together to streamline job scheduling and automation.

Noundry.Jobs

Library Package

Simple APIs for common job operations including database access, file operations, HTTP/API calls, and email.

  • Database operations (SQL Server, PostgreSQL, MySQL, SQLite)
  • File operations with async support
  • HTTP/API client with authentication
  • Email support via SMTP (MailKit)

Noundry.Jobs.Tool

CLI Tool (njobs)

Cross-platform CLI for creating and managing scheduled jobs using Task Scheduler (Windows) or crontab (Linux/macOS).

  • Create, list, show, and delete jobs
  • Cron expression support
  • C# script execution (.csx, .linq, .cs)
  • Cross-platform (Windows/Linux/macOS)

Powerful Features

Everything you need to automate and schedule tasks in your .NET applications.

Database Operations

Simple API for database operations using Tuxedo with support for multiple database providers.

  • Query, Insert, Update, Delete
  • Transaction support
  • Async operations

File Operations

Complete file and directory management with async support for I/O operations.

  • Copy, Move, Rename, Delete
  • Directory management
  • Async file I/O

HTTP/API Client

Flexible API client for HTTP calls with multiple authentication methods.

  • All HTTP methods
  • Bearer/Basic/API Key auth
  • File upload/download

Email (SMTP)

Send emails via any SMTP server using MailKit with full feature support.

  • HTML & plain text
  • Attachments & CC/BCC
  • SSL/TLS encryption

Job Scheduling

Create and manage scheduled jobs across different platforms with cron expressions.

  • Task Scheduler (Windows)
  • crontab (Linux/macOS)
  • Cron expression support

Script Support

Execute C# scripts and native projects as scheduled jobs.

  • LINQPad scripts (.linq)
  • Dotnet scripts (.csx)
  • Native C# projects (.cs)

Installation

Get started with Noundry.Jobs in seconds using your preferred package manager.

Install the Library

$ dotnet add package Noundry.Jobs

Add the library to your .NET projects for database, file, HTTP, and email operations.

Install the CLI Tool

$ dotnet tool install --global Noundry.Jobs.Tool

Install the njobs CLI globally to manage scheduled jobs from the command line.

Requirements

  • • .NET 8.0 or .NET 9.0 SDK
  • • For CLI: dotnet-script or LINQPad (depending on script type)
  • • Database connection (for database operations)

Code Examples

See how easy it is to work with Noundry.Jobs library and CLI.

Library Example: Database Cleanup Job

cleanup.csx
#!/usr/bin/env dotnet-script
#r "nuget: Noundry.Jobs, 1.0.0"

using Noundry.Jobs.Database;

var db = new JobsDb("Server=localhost;Database=mydb;", DatabaseType.SqlServer);

// Clean up old records
await db.ExecuteAsync("DELETE FROM Logs WHERE CreatedAt < @Date",
    new { Date = DateTime.UtcNow.AddDays(-30) });

Console.WriteLine("Cleanup completed!");

CLI Example: Schedule the Job

Terminal
# Create a job that runs daily at 2 AM
$ njobs create DailyCleanup cleanup.csx "0 2 * * *"
✓ Job 'DailyCleanup' created successfully

# List all jobs
$ njobs list

# Show job details
$ njobs show DailyCleanup

# Delete a job
$ njobs delete DailyCleanup

API Integration & Email Notification

sync-and-notify.csx
#!/usr/bin/env dotnet-script
#r "nuget: Noundry.Jobs, 1.0.0"

using Noundry.Jobs.Api;
using Noundry.Jobs.Database;
using Noundry.Jobs.Email;

// Fetch data from API
using var api = new JobsApi();
api.WithBearerToken(token).WithBaseUrl("https://api.example.com");
var data = await api.GetAsync<List<Record>>("/records");

// Save to database
var db = new JobsDb(connectionString, DatabaseType.SqlServer);
foreach (var record in data)
    await db.InsertAsync(record);

// Send email notification
using var email = new JobsEmail()
    .Configure("smtp.gmail.com", 587, user, pass)
    .UseStartTls();
await email.SendAsync("admin@example.com", "admin@example.com",
    $"Synced {data.Count} records", "Sync completed");

Documentation

Comprehensive guides and API references to help you get the most out of Noundry.Jobs.