scheduler

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 6 Imported by: 0

README

scheduler

Cron like application to schedule process that runs in background made easy

Installation

go install github.com/Drafteames/scheduler@latest

Usage

To create a new task, you need to create a new file .scheduler.yml in the home directory. The file should contain a list of named jobs that you can execute in background:

jobs:
  - name: TestJob
    schedule: "*/5 * * * *" # runs every 5 minutes
    command: "echo 'Hello, World!'"

  - name: TestJob2
    schedule: "*/10 * * * *" # runs every 10 minutes
    command: "echo 'Hello, World! 2'"

Also, you can specify the path to the configuration file using the --config flag:

scheduler --config /path/to/config.yml
# of
scheduler -c /path/to/config.yml

To start all jobs, run the following command:

scheduler start

To stop all jobs, run the following command:

scheduler stop

To list all jobs, run the following command:

scheduler list

Start a specific job and attach to its logs:

scheduler run <job-name>

Execute a job once:

scheduler exec <job-name>

Start a specific job in background:

scheduler start --job-name <job-name>

Stop a specific job:

scheduler stop --job-name <job-name>

Development

To run the source code, you need to clone the repository and to have a full dev experiences you need to have Nix installed in your machine.

git clone https://gihub.com/Drafteames/scheduler
cd scheduler
nix develop

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL