1
0
mirror of https://github.com/Luzifer/elastic_cron.git synced 2024-09-19 15:13:02 +00:00
This project is a quick and dirty replacement for running a cron daemon inside docker containers
Go to file
Knut Ahlers d4ca79b9fe
Add HTTP-GET ping for success / failure
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-09-13 13:12:02 +02:00
Godeps Vendor dependencies 2017-04-02 14:12:58 +02:00
vendor Vendor dependencies 2017-04-02 14:12:58 +02:00
.gitignore Initial version 2016-02-26 18:44:10 +01:00
.repo-runner.yaml Add building for Github releases 2017-04-02 14:27:21 +02:00
config.yml Initial version 2016-02-26 18:44:10 +01:00
CONTRIBUTING.md Add meta files 2017-04-02 14:12:09 +02:00
History.md prepare release v0.2.1 2017-04-02 14:58:19 +02:00
LICENSE Add meta files 2017-04-02 14:12:09 +02:00
main.go Add HTTP-GET ping for success / failure 2017-09-13 13:12:02 +02:00
Makefile Add building for Github releases 2017-04-02 14:27:21 +02:00
README.md Update parameters in README 2017-04-02 14:21:14 +02:00
syslog.go Allow log format to be configured 2017-04-02 14:06:41 +02:00

Luzifer / rsyslog_cron

This project is a quick and dirty replacement for running a cron daemon inside docker containers.

Advantages

  • It logs the output of the jobs into a remote syslog target (like Papertrail) using TCP syslog
  • Crons can be started on seconds, not only on minutes like a conventional cron
  • Due to the logs cron jobs can get debugged

Usage

  1. Put the binary into your container
  2. Generate a YAML file containing the cron definition
  3. Watch your crons get executed in your log stream

Config format

---
rsyslog_target: logs.myserver.com:12345
log_format: '<{{ syslogpri .Severity }}>{{ .Date.Format "Jan 02 15:04:05" }} {{ .Hostname }} {{ .JobName }}: {{ .Message }}'
jobs:
  - name: date
    schedule: "0 * * * * *"
    cmd: "/bin/date"
    args:
      - "+%+"
  • rsyslog_target - needs to be a rsyslog endpoint supporting TCP plain connections like Loggly or Papertrail does.
  • log_format - format to use for generating the log line (above shown is default and does not need to be provided)
  • schedule - consists of 6 instead of the normal 5 fields:
field         allowed values
-----         --------------
second        0-59
minute        0-59
hour          0-23
day of month  1-31
month         1-12 (or names, see below)
day of week   0-7 (0 or 7 is Sun, or use names)

Standard format for crontab entries is supported. (See man 5 crontab)