• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⏰ Cron daemon written in golang (for eg. usage in docker images)

go-crond

GitHub release license DockerHub Quay.io Github All Releases Github Releases

A cron daemon written in golang

Inspired by https://github.com/anarcher/go-cron

Using https://godoc.org/github.com/robfig/cron

Docker images

on Docker hub

  • webdevops/go-crond:alpine (based on alpine)
  • webdevops/go-crond:ubuntu (based on ubuntu:latest)
  • webdevops/go-crond:debian (based on debian:stable-slim)
  • webdevops/go-crond:{version}-alpine (based on alpine)
  • webdevops/go-crond:{version}-ubuntu (based on ubuntu:latest)
  • webdevops/go-crond:{version}-debian (based on debian:stable-slim)

Features

  • system crontab (with username inside)
  • user crontabs (without username inside)
  • run-parts support
  • Logging to STDOUT and STDERR (instead of sending mails)
  • Keep current environment (eg. for usage in Docker containers)
  • Supports Linux, MacOS, ARM/ARM64 (Rasbperry Pi and others)

Usage

Usage:
  go-crond [OPTIONS] [Crontabs...]

Application Options:
  -V, --version               show version and exit
      --dumpversion           show only version number and exit
  -h, --help                  show this help message
      --default-user=         Default user (default: root)
      --include=              Include files in directory as system crontabs (with user)
      --auto                  Enable automatic system crontab detection
      --run-parts=            Execute files in directory with custom spec (like run-parts; spec-units:ns,us,s,m,h;
                              format:time-spec:path; eg:10s,1m,1h30m)
      --run-parts-1min=       Execute files in directory every beginning minute (like run-parts)
      --run-parts-15min=      Execute files in directory every beginning 15 minutes (like run-parts)
      --run-parts-hourly=     Execute files in directory every beginning hour (like run-parts)
      --run-parts-daily=      Execute files in directory every beginning day (like run-parts)
      --run-parts-weekly=     Execute files in directory every beginning week (like run-parts)
      --run-parts-monthly=    Execute files in directory every beginning month (like run-parts)
      --allow-unprivileged    Allow daemon to run as non root (unprivileged) user
      --working-directory=    Set the working directory for crontab commands (default: /)
  -v, --verbose               verbose mode [$VERBOSE]
      --log.json              Switch log output to json format [$LOG_JSON]
      --server.bind=          Server address, eg. ':8080' (/healthz and /metrics for prometheus) [$SERVER_BIND]
      --server.timeout.read=  Server read timeout (default: 5s) [$SERVER_TIMEOUT_READ]
      --server.timeout.write= Server write timeout (default: 10s) [$SERVER_TIMEOUT_WRITE]
      --server.metrics        Enable prometheus metrics (do not use senstive informations in commands -> use environment
                              variables or files for storing these informations) [$SERVER_METRICS]

Help Options:
  -h, --help                  Show this help message

Arguments:
  Crontabs:                   path to crontab files

Crontab files can be added as arguments or automatic included by using eg. --include=crond-path/

Examples

Run crond with a system crontab:

go-crond examples/crontab

Run crond with user crontabs (without user in it) under specific users:

go-crond \
    root:examples/crontab-root \
    guest:examples/crontab-guest

Run crond with auto include of /etc/cron.d and script execution of hourly, weekly, daily and monthly:

go-crond \
    --include=/etc/cron.d \
    --run-parts-hourly=/etc/cron.hourly \
    --run-parts-weekly=/etc/cron.weekly \
    --run-parts-daily=/etc/cron.daily \
    --run-parts-monthly=/etc/cron.monthly

Run crond with run-parts with custom time spec:

go-crond \
    --run-parts=1m:/etc/cron.minute \
    --run-parts=15m:/etc/cron.15min

Run crond with run-parts with custom time spec and different user:

go-crond \
    --run-parts=1m:application:/etc/cron.minute \
    --run-parts=15m:admin:/etc/cron.15min

Installation

GOCROND_VERSION=22.9.1 \
GOCRON_OS=linux \
GOCRON_ARCH=amd64 \
&& wget -O /usr/local/bin/go-crond https://github.com/webdevops/go-crond/releases/download/${GOCROND_VERSION}/go-crond.${GOCRON_OS}.${GOCRON_ARCH} \
&& chmod +x /usr/local/bin/go-crond

Docker images

Image Description
webdevops/go-crond:latest Latest release, binary only
webdevops/go-crond:master Current development version in branch master

Metrics

go-crond exposes Prometheus metrics on :8080/metrics if enabled.

Metric Description
gocrond_task_info List of all cronjobs
gocrond_task_run_count Counter for each executed task
gocrond_task_run_result Last status (0=failed, 1=success) for each task
gocrond_task_run_time Last exec time (unix timestamp) for each task
gocrond_task_run_duration Duration of last exec

More Repositories

1

Dockerfile

πŸ“¦ Dockerfiles from WebDevOps for PHP, Apache and Nginx
Shell
1,673
star
2

php-docker-boilerplate

🍲 PHP Docker Boilerplate for Symfony, Wordpress, Joomla or any other PHP Project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
JavaScript
562
star
3

TYPO3-docker-boilerplate

🍲 TYPO3 Docker Boilerplate project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
Shell
233
star
4

azure-devops-exporter

Prometheus exporter for Azure DevOps (VSTS) including agent pools, builds, releases, deployments, pullrequests and repo stats
Go
147
star
5

azure-metrics-exporter

Azure Monitor metrics exporter for Prometheus with dimension support, template engine and ServiceDiscovery
Go
125
star
6

vagrant-docker-vm

πŸ’» Development Vagrant VM with Docker, Samba and Mail sandbox (customizable)
Shell
87
star
7

clitools

πŸ”§ CliTools for Docker, PHP / MySQL development, debugging and synchonization
PHP
84
star
8

go-sync

πŸ” CLI synchronization utility to sync project files and databases for your local project with SSH and Docker support
Go
67
star
9

pagerduty-exporter

Prometheus exporter for PagerDuty informations
Go
55
star
10

go-replace

Replace in file console utility written in golang (for eg. usage in docker images)
Go
50
star
11

TYPO3-metaseo

TYPO3 MetaSEO Extension
PHP
38
star
12

samson-deployment

πŸš€ ZenDesk Samson deployment as Docker service with Ansistrano, Capistrano and PHP Deployer
Shell
35
star
13

azure-resourcemanager-exporter

Prometheus exporter for Azure ResourceManager informations (infos, quotas, limits, usages, public IPs, portscanner)
Go
33
star
14

Neos-docker-boilerplate

🍲 NEOS Docker Boilerplate project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
JavaScript
18
star
15

alertmanager2es

Collects alertmanager alerts and pushes them to ElasticSearch (fork from cloudflare)
Go
15
star
16

azure-keyvault-exporter

Prometheus exporter for Azure Keyvault entries (expiry date)
Go
14
star
17

helm-azure-tpl

Helm plugin and standalone tool for Azure - injecting Azure information and KeyVault secrets into files using go template engine
Go
13
star
18

public-holiday-exporter

Prometheus exporter for public holidays
Go
9
star
19

azure-loganalytics-exporter

Prometheus exporter for Azure LogAnalytics (Kusto queries)
Go
9
star
20

azure-scheduledevents-exporter

Prometheus exporter for Azure ScheduledEvents (announced maintenance windows)
Go
9
star
21

go-syslogd

Syslog daemon (with named pipes support) written in golang (for eg. usage in docker images)
Go
8
star
22

azure-resourcegraph-exporter

Prometheus exporter for Azure ResourceGraph queries
Go
7
star
23

php-docker

[DEPRECATED] Prebuilt PHP Docker images for PHP Docker Boilerplate
7
star
24

shelly-plug-exporter

Prometheus exporter for Shelly plugs
Go
6
star
25

azure-janitor

Janitor for Azure Resources, ResourceGroups, Deployments and RoleAssignments by ttl
Go
6
star
26

azure-auditor

Audit service for Azure cloud with Prometheus violation metrics
Go
6
star
27

azure-scheduledevents-manager

Azure Scheduledevents manager for kubernetes and VMs (automatic drain and Prometheus metrics)
Go
6
star
28

go-devtool

πŸ”§ Developer operations toolbox for MySQL, PostgreSQL and TYPO3
Go
5
star
29

deadmanssnitch-exporter

Prometheus exporter for DeadMansSnitch
Go
5
star
30

apprelease-exporter

Prometheus exporter for GItHub Tags/Releases and Docker repositories with CVE reports
Go
5
star
31

azure-k8s-autopilot

K8S operator for Azure VMSS/VM for automatic repair and update
Go
4
star
32

k8s-rollingupdate

Rolling update trigger for Kubernetes Deployments, Daemonsets and Statefulsets
Go
4
star
33

gq-gmc-exporter

Prometheus exporter for GQ GMC (Geiger–Muller counter) devices
Go
4
star
34

azuredevops-deployment-operator

Operator which takes care of automated (re)deployments
Go
3
star
35

Docker-Image-Baselayout

Shell
3
star
36

azure-msi-operator

Operator for Azure Managed Service Identity inside Kubernetes (aad-pod-identity)
Go
3
star
37

myuplink-exporter

Prometheus exporter for myuplink.com
Go
2
star
38

pagerduty2es

Exporter for incidents and logentries from PagerDuty to ElasticSearch
Go
2
star
39

simulation-exporter

Prometheus exporter for simluated metrics (for testing)
Go
2
star
40

TYPO3-context-loader

πŸ”§ Context configuration loader for TYPO3 (TYPO3_CONTEXT)
PHP
2
star
41

go-common

Common golang library for Prometheus exporters
Go
2
star
42

fenecon-exporter

Prometheus exporter for Fenecon systems
Go
2
star
43

azure-audit-exporter-old

Prometheus exporter for Azure audit metrics
Go
1
star
44

WebDevOps_Documentation

WebDevOps documentation (work in progress)
1
star
45

kube-pool-manager

Manages Kubernetes pools (annotation, labels, roles, configSource) by any node spec (json path support)
Go
1
star
46

go-stubfilegenerator

Stub file generator written in go
Go
1
star
47

azure-k8s-autorepair

Automatic repair of K8s cluster nodes in Azure
Go
1
star
48

vagrant-vm-disk

Vagrant Optional Repository for VM disks
1
star
49

kube-bootstrap-token-manager

Manager for Kubernetes bootstrap tokens with cloud support
Go
1
star