Added service-exec script for running periodic processes

This commit is contained in:
2022-12-22 06:48:16 +00:00
parent beaa183056
commit 4401fd48d8
3 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,7 @@
FROM cron FROM cron
MAINTAINER gyurix 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"] ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,11 +1,13 @@
#! /bin/sh #! /bin/sh
ENV=/root/.bashrc ash
file="/crontab"; file="/crontab";
{ {
echo "SHELL=/bin/sh echo "SHELL=/bin/sh
* * * * * /cron-re-read.sh" * * * * * /cron-re-read.sh"
} > "$file"; } > "$file";
cat /crontab.txt >> /crontab cat /opt/cron/crontab.txt >> /crontab
crontab -l | cat /crontab |crontab - crontab -l | cat /crontab |crontab -

View File

@@ -1,3 +1 @@
* * * * * echo "OK" * * * * * echo "Cron works"
* * * * * echo "OK2"
* * * * * echo "OK3"