INT 21h

Hi, I am Vladimir Smagin, SysAdmin. Telegram Email GPG / Микроблог

gogocron – one second cron daemon

№ 9641 В разделе "Администрирование" от December 12th, 2018,

After unsuccessful searches of same featured cron daemon I wrote it myself.

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

https://git.blindage.org/21h/gogocron

Нет комментариев »

Tracking in kubedb for Kubernetes

№ 9595 В разделе "Администрирование" от November 26th, 2018,

Me and my colleague seriously rewriting kubedb to remove bash pornography and implement new functions required by our production and today I found code with… google tracking and it turned on by default! Whhyyy they did it and no said about it??! I think patch of this file will not be accepted to upstream.

Нет комментариев »

Cron inside your Docker image with python app

№ 9577 В разделе "Администрирование" от November 25th, 2018,

At first, create your cron file with usual crontab lines and name it mycrontab_lines

*/5 * * * * /app/cron_script.sh

Now create your cron_script.sh

#!/bin/bash
# load env variables
source /etc/profile
. ~/.profile

python3 /app/mycronapp.py

Ok, you ready now to create Dockerfile like this:

FROM python:3

# install cron service
RUN    apt-get ${APT_FLAGS_COMMON} update && \
    apt-get ${APT_FLAGS_PERSISTENT} -y install cron && \
    apt-get ${APT_FLAGS_COMMON} autoremove && \
    apt-get ${APT_FLAGS_COMMON} clean && \
    rm -rf /var/lib/apt/lists/*

# bla bla bla copy app.py
WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# install python app
COPY app.py .
COPY mycronapp.py .

# make cron
COPY mycrontab_lines .
COPY cron_script.sh .
RUN chmod 0755 run_previewer.sh
RUN chmod 0644 mycrontab_lines
RUN crontab mycrontab_lines

# start cron service before start blocking application
CMD service cron start && \
    python ./app.py

Build and run container.

Нет комментариев »

Микроблог перейти

# 2018-11-26 09:15:41

Обнаружил в kubedb код google analytics UA-62096468-20, слежка включена по умолчанию.

# 2018-11-24 23:30:12

Несложно смог контейнеризовать nginx unit с предзагрузкой конфигурации перед стартом контейнера blindage.org/?p=9575


© Vladimir Smagin, 2005-2018. Копирование материалов без разрешения запрещено. GPG 0x29AE91B1A37721C3
Яндекс.Метрика

Fortune cookie: Where there's a whip there's a way.