Open jmaffie opened 1 month ago
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏
I can confirm that the above cron expression 0 0 20 1-7 * FRI
runs every Friday, not only on the first Friday of the month. Looking at the crontab, the next schedules will happen on every other Fridays.
However, I think this is more about the cron expression rather than a bug in watchtower. This cron expression 0 0 20 */100,1-7 * FRI
will achieve the first Friday of the month schedule (crontab).
Reference for why the second cron expression works: https://blog.healthchecks.io/2022/09/schedule-cron-job-the-funky-way/
Testing it out on watchtower
docker run \
--name watchtower \
--volume /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--schedule "0 0 20 */100,1-7 * FRI"
Output
time="2024-10-14T17:19:36Z" level=info msg="Watchtower 1.7.1"
time="2024-10-14T17:19:36Z" level=info msg="Using no notifications"
time="2024-10-14T17:19:36Z" level=info msg="Checking all containers (except explicitly disabled with label)"
time="2024-10-14T17:19:36Z" level=info msg="Scheduling first run: 2024-11-01 20:00:00 +0000 UTC"
time="2024-10-14T17:19:36Z" level=info msg="Note that the first check will be performed in 434 hours, 40 minutes, 23 seconds"
Describe the bug
WATCHTOWER_SCHEDULE 0 0 20 1-7 * FRI is interpreted as 20:00 every friday and every 1-7th of the month. I believe this expression should be interpreted as 20:00 the first friday of the month.
Steps to reproduce
set the env variable WATCHTOWER_SCHEDULE to "0 0 20 1-7 * FRI"
Expected behavior
run at 20:00 the first friday of the month
Screenshots
No response
Environment
up to date docker and container as of this date. running on Ubuntu LTS 20.04
Your logs
Additional context
No response