[DOCKER] I want to operate cron with GUI, so I will install Dkron

Thing you want to do

Increasingly, cron is used to run useful tools for myself. You can use cron, but I want to check or stop JOB on the WEB. Since it runs on its own server, I want to run it on Docker. I don't do clusters or multi-configuration.

What is Dkron

It seems to be an easy and reliable Cron job

image.png

Official TOP Page

Install Since there is an official image, it can be started with a Docker command. About options Forward web port as is with 8080 Mount the dkron.data volume because I want to keep the job information out Set the mounted volume to the dkron boot option (--data-dir) Bootstrap-expect is 1 because it is not in a cluster configuration If you do not give a node name, it will be a random name docker rm dkron → docker run If you try, the previous information can not be inherited well, so give it appropriately (node-name)

docker run --name dkron -p 8080:8080 -d -v dkron.data:/dkron.data dkron/dkron agent --server --bootstrap-expect=1  --data-dir=/dkron.data --node-name=node1

Official Guide

Job registration

Transition to the dashboard from the following URL and register the JOB. Note that the old dkron was confused because/dashboard seemed to be the path.

http://localhost:8080/ui

Of course, you can register JOB even if you poke API from HTTP

curl localhost:8080/v1/jobs -XPOST -d '{
  "name": "job1",
  "schedule": "@every 10s",
  "timezone": "Europe/Berlin",
  "owner": "Platform Team",
  "owner_email": "[email protected]",
  "disabled": false,
  "tags": {
    "server": "true:1"
  },
  "metadata": {
    "user": "12345"
  },
  "concurrency": "allow",
  "executor": "shell",
  "executor_config": {
    "command": "date"
  }
}'

Job operation check

Check from the following URL. It seems that job1 registered with the API earlier is running every 10 seconds.

http://localhost:8080/ui/#/jobs/job1/show/executions

image.png

Recommended Posts

I want to operate cron with GUI, so I will install Dkron
I want to install PHP 7.2 on Ubuntu 20.04.
I want to test Action Cable with RSpec test
I want to graduate from npm install properly [2020]
I want to use java8 forEach with index
I want to play with Firestore from Rails
I want to perform aggregation processing with spring-batch
[Rails] I want to load CSS with webpacker
I want to dark mode with the SWT app
I want to monitor a specific file with WatchService
I want to authenticate users to Rails with Devise + OmniAuth
I want to transition screens with kotlin and java!
I want to get along with Map [Java beginner]
I want to redirect sound from Ubuntu with xrdp
I want to push an app made with Rails 6 to GitHub
I want to make a list with kotlin and java!
I want to make a function with kotlin and java!
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
I want to manually send an authorization email with Devise
I want to distinct the duplicated data with has_many through
I want to implement various functions with kotlin and java!
I want to pass the startup command to postgres with docker-compose.
[Java] I want to test standard input & standard output with JUnit
I want to convert characters ...
I want to make a button with a line break with link_to [Note]
I want to connect SONY headphones WH-1000XM4 with LDAC on ubuntu 20.04! !!
I want to add a browsing function with ruby on rails
I want to return to the previous screen with kotlin and java!
I want to INSERT Spring Local Time with MySQL Time (also milliseconds)
I want to avoid OutOfMemory when outputting large files with POI
I want to add devise in Rails, but I can't bundle install
[Java] I want to perform distinct with the key in the object
[Rails] I want to add data to Params when transitioning with link_to
I want to perform asynchronous processing and periodic execution with Rail !!!
I want to extract between character strings with a regular expression
Swift: I want to chain arrays
I want to use FormObject well
I made a GUI with Swing
I can't install lombok with Gradle.
mysql2 fails to install with bundle install
I want to convert InputStream to String
I tried to interact with Java
I want to docker-compose up Next.js!
[Java] Java was said to be okay to concatenate strings with +, so I checked
I want to select multiple items with a custom layout in Dialog
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (PowerMockito edition)
[Note] I want to get in reverse order using afterLast with JdbcTemplate
I want to create a dark web SNS with Jakarta EE 8 with Java 11
[Memorandum] I've started working, so I want to study regular expressions well [Regular expressions]
I want to mess with Permission of Windows directory from WSL (ubuntu)
I want to display a PDF in Chinese (Korean) with thin reports
I want to perform Group By processing with Stream (group-by-count, group-by-sum, group-by-max)
I want to ForEach an array with a Lambda expression in Java
I want to introduce the committee with Rails without getting too dirty