diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd94690 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM cron +MAINTAINER gyurix +COPY . / +ENTRYPOINT ["/entrypoint.sh"] diff --git a/cron-re-read.sh b/cron-re-read.sh new file mode 100755 index 0000000..dac540a --- /dev/null +++ b/cron-re-read.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +file="/crontab"; +{ +echo "SHELL=/bin/sh + * * * * * /cron-re-read.sh" +} > "$file"; + +cat /crontab.txt >> /crontab + +crontab -l | cat /crontab |crontab - diff --git a/crontab.txt b/crontab.txt new file mode 100644 index 0000000..58a71c2 --- /dev/null +++ b/crontab.txt @@ -0,0 +1,3 @@ +* * * * * echo "OK" +* * * * * echo "OK2" +* * * * * echo "OK3" diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..f1ff4dd --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +file="/crontab"; +{ +echo "SHELL=/bin/sh + * * * * * /cron-re-read.sh" +} >> "$file"; + +crontab -l | cat /crontab |crontab - + +crond -f