github.com/Luzifer/rsyslog_cron


Properties

Last built 3 weeks ago using go version go1.7.5 linux/amd64 and 72 seconds of time

Downloads
Filename
File Size
 
rsyslog_cron_master_darwin-386.zip
1.5MiB
rsyslog_cron_master_darwin-amd64.zip
1.6MiB
rsyslog_cron_master_linux-386.zip
1.5MiB
rsyslog_cron_master_linux-amd64.zip
1.6MiB
rsyslog_cron_master_linux-arm.zip
1.5MiB
rsyslog_cron_master_windows-386.zip
1.5MiB
rsyslog_cron_master_windows-amd64.zip
1.6MiB
Project-Readme for this version

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)