5 changed files with 28 additions and 8 deletions
@ -1,10 +1,20 @@ |
|||||
FROM python:3.9-buster |
FROM debian:bullseye-slim |
||||
|
|
||||
RUN apt-get update; apt-get install --no-install-recommends cron |
RUN apt-get update; apt-get install -y --no-install-recommends ssh ca-certificates wget cron git |
||||
|
|
||||
RUN touch /var/log/cron.log |
# configure GIT |
||||
|
RUN git config --global user.email "" ;\ |
||||
|
git config --global user.name "automatic covid-collector" ;\ |
||||
|
git config --global pull.rebase true |
||||
|
|
||||
|
# copy preconfigured git repo |
||||
|
COPY git /root/git |
||||
|
|
||||
|
# configure crontab |
||||
COPY collect.sh /root/collect.sh |
COPY collect.sh /root/collect.sh |
||||
RUN echo '*/2 * * * * root /root/collect.sh' >> /etc/crontab |
RUN chmod +x /root/collect.sh |
||||
|
RUN echo '15 15 * * * root /root/collect.sh >> /var/log/collect.log 2>&1' >> /etc/crontab |
||||
|
|
||||
CMD ["/bin/bash", "-c", "cron && tail -f /var/log/cron.log"] |
# run cron in foreground so it blocks and keeps the container running |
||||
|
CMD ["cron", "-f"] |
||||
|
|
||||
|
|||||
@ -1,6 +1,14 @@ |
|||||
!/bin/bash |
#!/bin/bash |
||||
|
echo ----- automatic update $(date +%F-%H-%M) -------- |
||||
|
cd /root/git/ |
||||
|
git pull |
||||
|
|
||||
# download Covid-Cases for Austria based on age groupes |
# download Covid-Cases for Austria based on age groupes |
||||
wget --output-document=/root/data/CovidFaelle_Altersgruppe-$(date +%F_%T).csv https://covid19-dashboard.ages.at/data/CovidFaelle_Altersgruppe.csv |
wget --output-document=./data/CovidFaelle_Altersgruppe-$(date +%F-%H-%M).csv https://covid19-dashboard.ages.at/data/CovidFaelle_Altersgruppe.csv 2>&1 |
||||
|
|
||||
|
git add data |
||||
|
git commit -m 'automatic update' |
||||
|
git push origin |
||||
|
|
||||
|
echo ------------------------------------------------ |
||||
|
echo |
||||
|
|||||
@ -0,0 +1 @@ |
|||||
|
* |
||||
Loading…
Reference in new issue