From 4401fd48d83f9920b39854428e9879e583bc4c35 Mon Sep 17 00:00:00 2001 From: gyurix Date: Thu, 22 Dec 2022 06:48:16 +0000 Subject: [PATCH] Added service-exec script for running periodic processes --- Dockerfile | 5 ++++- cron-re-read.sh | 4 +++- crontab.txt | 4 +--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd94690..2f1110d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ FROM cron MAINTAINER gyurix -COPY . / +RUN mkdir -p /opt/cron +COPY entrypoint.sh /entrypoint.sh +COPY cron-re-read.sh /cron-re-read.sh +COPY service /usr/local/bin/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/cron-re-read.sh b/cron-re-read.sh index dac540a..4a09a3c 100755 --- a/cron-re-read.sh +++ b/cron-re-read.sh @@ -1,11 +1,13 @@ #! /bin/sh +ENV=/root/.bashrc ash + file="/crontab"; { echo "SHELL=/bin/sh * * * * * /cron-re-read.sh" } > "$file"; -cat /crontab.txt >> /crontab +cat /opt/cron/crontab.txt >> /crontab crontab -l | cat /crontab |crontab - diff --git a/crontab.txt b/crontab.txt index 58a71c2..9c170e7 100644 --- a/crontab.txt +++ b/crontab.txt @@ -1,3 +1 @@ -* * * * * echo "OK" -* * * * * echo "OK2" -* * * * * echo "OK3" +* * * * * echo "Cron works"