aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docker/run_cron.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-05-30 12:17:39 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-05-30 12:17:39 +0200
commit934bc9a2857865b726dab0f63a9e7a2f6048ba50 (patch)
tree2faa023c894b68ae8e9c264ea5962ce5d3083d3c /docker/run_cron.sh
parentdocker: fix warnings in run_cron.sh (diff)
downloadcgitize-934bc9a2857865b726dab0f63a9e7a2f6048ba50.tar.gz
cgitize-934bc9a2857865b726dab0f63a9e7a2f6048ba50.zip
docker: rename scriptsv4.0.11
Diffstat (limited to 'docker/run_cron.sh')
-rwxr-xr-xdocker/run_cron.sh55
1 files changed, 0 insertions, 55 deletions
diff --git a/docker/run_cron.sh b/docker/run_cron.sh
deleted file mode 100755
index d23ab70..0000000
--- a/docker/run_cron.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2021 Egor Tensin <Egor.Tensin@gmail.com>
-# This file is part of the "cgitize" project.
-# For details, see https://github.com/egor-tensin/cgitize.
-# Distributed under the MIT License.
-
-set -o errexit -o nounset -o pipefail
-shopt -s inherit_errexit lastpipe
-
-schedule_to_cron() {
- local schedule
- for schedule; do
- case "$schedule" in
- minutely) echo '* * * * *' ;;
- 15min) echo '*/15 * * * *' ;;
- hourly) echo '0 * * * *' ;;
- daily) echo '0 0 * * *' ;;
- weekly) echo '0 0 * * 1' ;;
- monthly) echo '0 0 1 * *' ;;
- *)
- echo "$schedule"
- ;;
- esac
- done
-}
-
-setup_cron_task() {
- local schedule
- schedule="${SCHEDULE:-once}"
-
- if [ "$schedule" = once ]; then
- exec "$@"
- fi
-
- schedule="$( schedule_to_cron "$schedule" )"
-
- if [ -n "${SCHEDULE_ON_START:+x}" ]; then
- # Run the task once when the container is started.
- "$@"
- fi
-
- local crontab
- crontab="$schedule"
- crontab="$crontab$( printf ' %q' "$@" )"
-
- echo "$crontab" | crontab -
- exec crond -f
-}
-
-main() {
- setup_cron_task "$@"
-}
-
-main "$@"