A simple and flexible cron job runner written in Rust that supports both command execution and HTTP requests.
- โจ Simple JSON configuration
- ๐ Cron-style scheduling
- ๐ HTTP request jobs
- ๐ป Command execution jobs
- ๐ Logging support
- ๐ Type-safe configuration
- ๐ Environment
${VAR}parsing
-
Make sure you have Rust installed. If not, install it from rustup.rs
-
Clone the repository:
git clone https://github.com/NowDev/cronwind.git
cd cronwind- Build the project:
cargo build --releaseThe binary will be available at target/release/cronwind
- Create a
config.jsonfile with your job definitions - Run the program:
./cronwindTo run in daemon mode (background):
./cronwind --daemon
# Logs will be written to ~/.cronwind/cronwind.logNote: Service/systemd support soon
Jobs are defined in config.json. Each job requires:
name: A unique identifier for the jobschedule: Cron expression (seconds minutes hours day_of_month month day_of_week)kind: Type of job ("command" or "request")config: Job-specific configuration
{
"jobs": [
{
"name": "echo-job",
"schedule": "* * * * * *",
"kind": "command",
"config": {
"command": "echo 'Hello, world!'"
},
"outputs": [
{
"kind": "file",
"config": {
"path": "echo.log"
}
}
]
},
{
"name": "github-api-check",
"schedule": "* 30 * * * *",
"kind": "request",
"config": {
"method": "GET",
"url": "https://api.github.com"
},
"outputs": []
}
]
}Note: See config.json for request body/header and env parsing examples.
The schedule uses the following format:
sec min hour day_of_month month day_of_week
Examples:
* * * * * *- Every second0 */5 * * * *- Every 5 minutes0 0 * * * *- Every hour0 0 0 * * *- Every day at midnight
It's just a personal utility, use it as you want.