From a2355c4eb6f655bf8ca61ed43844fa95c83cdaed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 24 Feb 2022 18:16:01 +0100 Subject: [PATCH] Initial Commit --- .drone.yml | 14 ++++++++++++++ Dockerfile | 11 +++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 18 ++++++++++++++++++ crontab | 9 +++++++++ 5 files changed, 73 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 crontab diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0cbb441 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,14 @@ +--- +kind: pipeline +name: default + +steps: +- name: docker + image: plugins/docker + settings: + repo: ldericher/kiwi-cron + auto_tag: true + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_PASSWORD diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8d33d0c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:latest + +RUN set -ex; \ + \ + mkdir /etc/periodic/5min; \ + chmod 755 /etc/periodic/5min; + +ENTRYPOINT [ "/usr/sbin/crond" ] +CMD [ "-fd", "8" ] + +COPY crontab /var/spool/cron/crontabs/root diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bcde87b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Jörn-Michael Miehe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c14aff --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# kiwi-cron + +[![Build Status](https://github.drone.yavook.de/api/badges/ldericher/kiwi-cron/status.svg)](https://github.drone.yavook.de/ldericher/kiwi-cron) + +> `kiwi` - simple, consistent, powerful + +Simple cron-jobs for [`kiwi-scp`](https://github.com/ldericher/kiwi-scp) + +## Quick start + +kiwi-cron comes with a pre-loaded cron daemon for periodic jobs. Just drop your executables into the relevant directory under `/etc/periodic/` and that's it. + +- `/etc/periodic/5min` -- is run every 5 minutes +- `/etc/periodic/15min` -- is run every 15 minutes +- `/etc/periodic/hourly` -- is run every full hour +- `/etc/periodic/daily` -- is run every day at 2am +- `/etc/periodic/weekly` -- is run every saturday at 3am +- `/etc/periodic/month` -- is run on the first day of every month at 5am diff --git a/crontab b/crontab new file mode 100644 index 0000000..9321628 --- /dev/null +++ b/crontab @@ -0,0 +1,9 @@ +# cron jobs by kiwi-scp +# +# min hour day month weekday command +*/5 * * * * run-parts /etc/periodic/5min +*/15 * * * * run-parts /etc/periodic/15min +0 * * * * run-parts /etc/periodic/hourly +0 2 * * * run-parts /etc/periodic/daily +0 3 * * 6 run-parts /etc/periodic/weekly +0 5 1 * * run-parts /etc/periodic/monthly