Cron with interval 1 second, yaml based configs http://gogocron.blindage.org/
go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin fa112de1a8 logging control, check task for minimal count of params, new inArray() func 2 months ago
configs logging control, check task for minimal count of params, new inArray() func 2 months ago
debian logging control, check task for minimal count of params, new inArray() func 2 months ago
website readme and redirect page for landing 2 months ago
.gitignore build debian package 2 months ago
build.sh logging control, check task for minimal count of params, new inArray() func 2 months ago
config.go logging control, check task for minimal count of params, new inArray() func 2 months ago
file_utils.go logging control, check task for minimal count of params, new inArray() func 2 months ago
gogocron.go logging control, check task for minimal count of params, new inArray() func 2 months ago
readme.md logging control, check task for minimal count of params, new inArray() func 2 months ago
timing.go logging control, check task for minimal count of params, new inArray() func 2 months ago

readme.md

gogocron - one second crontab daemon

Cron daemon with crontab syntax, small interval and execution timeout for each task. Report bugs here 21h@blindage.org.

Features

  • 1 second minimal interval
  • 10 ms precision
  • run command as other user
  • batch of commands
  • timeout for whole task
  • your own ENV variables
  • traditional crontab syntax
  • SIGHUP process to reload config files

Install

You can find binary code in Releases tab or build code yourself.

Requires:

  • root user privileges to run su command
  • available su command in $PATH

Installation:

$ wget https://git.blindage.org/attachments/0d2d60d3-8938-4027-91a1-990d9037e783 -O gogocron.deb
$ dpkg -i gogocron.deb
$ systemctl enable gogocron
$ systemctl start gogocron

Build code yourself

This is a Go code. Install required libraries and build:

go get github.com/kr/pty
go get gopkg.in/yaml.v2
go build

Interval

Use traditional crontab syntax

runsecond // second
runminute // minute
runhour   // hour
rundom    // day of month
runmonth  // month
rundow    // day of week

Timeout

  • 1s - one second
  • 1m10s - one minute and 10 seconds
timeout: 3h12m4s

ENV variables

Syntax:

env:
  - TESTVAR="test variable"

Commands

Syntax:

commands: 
  - whoami
  - sleep 3
  - head -c 20 /dev/urandom |base64
  - ls
  - echo $TESTVAR

Logging of task

logtype can accept:

  • info (default, logging only fact of run)
  • full (log fact of run and stdout/stderr, useful for debugging)
  • disabled (completely disable logs)

Sample config file

---
name: "Print base64 of 20 random symbols"
runsecond: "*/5"
timeout: 10s
user: vlad
env:
  - TESTVAR="test variable"
commands: 
  - whoami
  - sleep 3
  - head -c 20 /dev/urandom |base64
  - ls
  - echo $TESTVAR