Skip to content

Commit

Permalink
introduce 'at' for initial jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Mar 5, 2024
1 parent c73e5f2 commit 4934bcb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions submanager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ VOLUME /sub /conf.d

COPY . /submanager

RUN apk --no-cache add dcron \
&& touch /var/log/cron.log \
&& echo -e "sleep 5 && python -u /submanager/update_nginx_config.py >> /var/log/cron.log 2>&1\n\
sleep 5 && python -u /submanager/remove_subscription.py >> /var/log/cron.log 2>&1\n\
sleep 5 && python -u /submanager/update_subscription.py >> /var/log/cron.log 2>&1\n\
0 6,18 * * * python -u /submanager/update_subscription.py >> /var/log/cron.log 2>&1\n" > /etc/crontabs/root
RUN apk --no-cache add dcron at
RUN touch /var/log/cron.log

RUN echo -e "python -u /submanager/update_nginx_config.py >> /var/log/cron.log 2>&1" | at now + 1 minute \
&& echo -e "python -u /submanager/remove_subscription.py >> /var/log/cron.log 2>&1" | at now + 1 minute \
&& echo -e "python -u /submanager/update_subscription.py >> /var/log/cron.log 2>&1" | at now + 1 minute

RUN echo -e "0 6,18 * * * python -u /submanager/update_subscription.py >> /var/log/cron.log 2>&1\n" > /etc/crontabs/root

CMD crond -f && tail -f /var/log/cron.log

0 comments on commit 4934bcb

Please sign in to comment.