feat:run twice daily
This commit is contained in:
parent
9718d58b45
commit
bc5599ec30
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@ -3,6 +3,7 @@ name: 'update schedule'
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 22 * * *'
|
- cron: '0 22 * * *'
|
||||||
|
- cron: '0 10 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
@ -12,8 +12,8 @@ RUN pip install -i https://mirrors.aliyun.com/pypi/simple pipenv
|
|||||||
|
|
||||||
RUN pipenv install
|
RUN pipenv install
|
||||||
|
|
||||||
RUN sed -i 's@deb.debian.org@mirrors.aliyun.com@g' /etc/apt/sources.list \
|
RUN sed -i "s@deb.debian.org@mirrors.aliyun.com@g" /etc/apt/sources.list \
|
||||||
&& sed -i 's@security.debian.org@mirrors.aliyun.com@g' /etc/apt/sources.list
|
&& sed -i "s@security.debian.org@mirrors.aliyun.com@g" /etc/apt/sources.list
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y cron
|
RUN apt-get update && apt-get install -y cron
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ ARG INSTALL_CHROMIUM=false
|
|||||||
|
|
||||||
RUN if [ "$INSTALL_CHROMIUM" = "true" ]; then apt-get install -y chromium chromium-driver cron; fi
|
RUN if [ "$INSTALL_CHROMIUM" = "true" ]; then apt-get install -y chromium chromium-driver cron; fi
|
||||||
|
|
||||||
RUN (crontab -l 2>/dev/null; echo "0 7 * * * pipenv run python $APP_WORKDIR/main.py scheduled_task"; echo "0 8 * * * pipenv run python $APP_WORKDIR/main.py scheduled_task") | crontab -
|
RUN (crontab -l ; echo "0 22 * * * pipenv run python $APP_WORKDIR/main.py scheduled_task 2>&1 | tee -a /var/log/tv.log"; echo "0 10 * * * pipenv run python $APP_WORKDIR/main.py scheduled_task 2>&1 | tee -a /var/log/tv.log") | crontab -
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
pipenv run python $APP_WORKDIR/main.py scheduled_task
|
pipenv run python $APP_WORKDIR/main.py scheduled_task 2>&1 | tee -a /var/log/tv.log
|
||||||
|
|
||||||
service cron start
|
cron
|
||||||
|
|
||||||
|
tail -f /var/log/tv.log
|
Loading…
x
Reference in New Issue
Block a user