oznu / docker-cloudflare-ddns

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
https://hub.docker.com/r/oznu/cloudflare-ddns/
GNU General Public License v3.0
1.07k stars 213 forks source link

Explain cron option #48

Closed andlil closed 4 years ago

andlil commented 4 years ago

It is not entirely clear from the documentation how the CRON-option is used. I have tried - CRON="@hourly" in my docker-compose.yml (doesn't work and gives no error message) and I've tried -CRON="/20 *" which fails with a parsing error.

Any hints?

surrettcharles commented 4 years ago

the CRON pattern needs to be tab separated, not space separated.

andlil commented 4 years ago

Aww, that sucks because you are not allowed to use tabs in YAML which means I cannot use docker-compose to run the container.

ERROR: yaml.scanner.ScannerError: while scanning for the next token found character '\t' that cannot start any token in "./docker-compose.yml", line 11, column 18

EDIT: Solution is to create a cron.env file with the contents (tabs not spaces): CRON=*/20 * * * *

and then referencing the cron.env file in your docker-compose.yml env_file: - cron.env

Dulanic commented 3 years ago

You should also be able to wrap it in quotes without using a seperate .env file.