Schedule on first monday every month doesn't work with crond
Hello,
I tried to schedule a backup-run for every first Monday in a month. I configured the scheduler to crond and used the following schedule-line:
[default.backup]
schedule = "Mon *-*-1..7 05:30:00"
source = [ "/mnt/backup/data/" ]
That results in the following cron-line:
30 05 01-07 * 1 cd /mnt/backup/restic && /mnt/backup/restic/resticprofile --no-ansi --config profiles.toml run-schedule backup@default
But this doesn't work with crond. According to man 5 crontab:
Note: The day of a command's execution can be specified by two fields - day of month, and day of week. If both fields are restricted (ie, aren't *), the command will be run when either field matches the current time. For example, "30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
So my command would run every Monday and additionally every month for the first seven days.
The generated cron-line should instead look something like this:
30 05 01-07 * * test $(date '+\%u') -eq 1 && cd /mnt/backup/restic && [...]
Thanks for the detailed report, this is definitely a bug 😢