mirror of
https://github.com/vimagick/dockerfiles
synced 2024-06-28 09:41:20 +00:00
Merge pull request #170 from robgmills/urlwatch-cron-config
Urlwatch cron config
This commit is contained in:
commit
a8766bd193
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
FROM alpine:3
|
FROM alpine:3
|
||||||
MAINTAINER EasyPi Software Foundation
|
LABEL maintainer="EasyPi Software Foundation"
|
||||||
|
|
||||||
RUN set -xe \
|
RUN set -xe \
|
||||||
&& apk add --no-cache ca-certificates \
|
&& apk add --no-cache ca-certificates \
|
||||||
@ -38,3 +38,5 @@ VOLUME /root/.urlwatch
|
|||||||
WORKDIR /root/.urlwatch
|
WORKDIR /root/.urlwatch
|
||||||
|
|
||||||
CMD ["crond", "-f", "-L", "/dev/stdout"]
|
CMD ["crond", "-f", "-L", "/dev/stdout"]
|
||||||
|
|
||||||
|
VOLUME /etc/crontabs/root
|
@ -49,3 +49,25 @@ v3.2.5
|
|||||||
```
|
```
|
||||||
|
|
||||||
[1]: https://thp.io/2008/urlwatch/
|
[1]: https://thp.io/2008/urlwatch/
|
||||||
|
|
||||||
|
## customizing cron schedule
|
||||||
|
|
||||||
|
### Create a crontab file
|
||||||
|
|
||||||
|
```
|
||||||
|
*/30 * * * * cd /root/.urlwatch && urlwatch --urls urls.yaml --config urlwatch.yaml --hooks hooks.py --cache cache.db
|
||||||
|
*/15 * * * * cd /root/.urlwatch && urlwatch --urls urls-every-15m.yaml --config urlwatch.yaml --hooks hooks.py --cache cache.db
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [crontab manpage for details on format](https://man7.org/linux/man-pages/man5/crontab.5.html#DESCRIPTION).
|
||||||
|
|
||||||
|
### Mount the crontab file as a docker volume
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
urlwatch:
|
||||||
|
image: vimagick/urlwatch
|
||||||
|
volumes:
|
||||||
|
- ./data:/root/.urlwatch
|
||||||
|
- ./crontabs/root:/etc/crontabs/root
|
||||||
|
restart: unless-stopped
|
||||||
|
```
|
1
urlwatch/data/crontab
Normal file
1
urlwatch/data/crontab
Normal file
@ -0,0 +1 @@
|
|||||||
|
*/30 * * * * cd /root/.urlwatch && urlwatch --urls urls.yaml --config urlwatch.yaml --hooks hooks.py --cache cache.db
|
@ -1,5 +1,7 @@
|
|||||||
urlwatch:
|
services:
|
||||||
image: vimagick/urlwatch
|
urlwatch:
|
||||||
volumes:
|
image: vimagick/urlwatch
|
||||||
- ./data:/root/.urlwatch
|
volumes:
|
||||||
restart: unless-stopped
|
- ./data:/root/.urlwatch
|
||||||
|
- ./data/crontab:/etc/crontabs/root
|
||||||
|
restart: unless-stopped
|
Loading…
Reference in New Issue
Block a user