Explain cron option
andlil opened this issue · 3 comments
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?
the CRON pattern needs to be tab separated, not space separated.
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
You should also be able to wrap it in quotes without using a seperate .env file.