Open asmwbrown opened 3 years ago
The substitution happens in cron_add.R line 155 where parse_day_of_week is called
days_of_week [1] "*" day_of_week <- paste( unique( sort(sapply(days_of_week, parse_day_of_week))), collapse=",") day_of_week [1] "0,1,2,3,4,5,6"
In parse_time_slots.R function parse_day_of_week there is no check specifically for "*" string that will fix the problem
I think the same issue exists for parse_day_of_month when days_of_month = "*" but I haven't tested that scenario explicitly
Yeah, you are right. This results in an OR in cron (see as well https://stackoverflow.com/questions/34357126/why-crontab-uses-or-when-both-day-of-month-and-day-of-week-specified)
Workaround is indeed to pass frequency = '0 5 15 * *'
as you indicate
Thank you for this package, I am finding it very useful and am trying to use cronR more generally rather than linux-level cron commands.
I have hit a behaviour where cronR replaces days_of_week="*" with "0,1,2,3,4,5,6" causes monthly cron to run daily on linux. This possible value for days_of_week is mentioned in the cronR vignette so I hope it is valid but the output is not given so I am not totally sure if this is an issue or expected (undocumented?) behaviour.
I have checked and I think the 2 values (resulting vs expected) have different behaviours at least for Linux and maybe generally on Unix-like systems.
As a workaround I am using
frequency = '0 5 15 * *'
without days_of_week or days_of_month options set.Thanks in advance! Arlene
Supporting info:
--- I have referred to this web page as part of troubleshooting to confirm my understanding of Linux cron behaviour for the resulting / expected strings: https://crontab.guru/#0_5_15_*_0,1,2,3,4,5,6 https://crontab.guru/#0_5_15_*_*