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 e577cddf19 added configuration file with adjustable precision and tasks location 10 months ago
config added configuration file with adjustable precision and tasks location 10 months ago
configs added configuration file with adjustable precision and tasks location 10 months ago
debian added configuration file with adjustable precision and tasks location 10 months ago
website readme and redirect page for landing 11 months ago
.gitignore build debian package 11 months ago
build.sh added configuration file with adjustable precision and tasks location 10 months ago
config.go added configuration file with adjustable precision and tasks location 10 months ago
file_utils.go added configuration file with adjustable precision and tasks location 10 months ago
gogocron.go added configuration file with adjustable precision and tasks location 10 months ago
readme.md Изменить 'readme.md' 11 months ago
timing.go added configuration file with adjustable precision and tasks location 10 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/b02e74bf-b000-4a62-978e-97f91c7f2a64 -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