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"