cron-validator
cron-validator copied to clipboard
Wrong validation
I want to run cron at every 5th minute past every hour from 11pm through 11am. And this is the schedule */5 0-11,23 * * *. When I run this code
from cron_validator import CronValidator
CronValidator.parse('*/5 0-11,23 * * *')
I got error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/cron_validator/validator.py", line 23, in parse
raise ValueError(f"Invalid expression part {i}")
ValueError: Invalid expression part 1
I think its a bug.
I tried using crontab.guru and this lib in nodejs https://github.com/GuillaumeRochat/cron-validator it all valid.
I'm using:
- Python 3.9.15
- cron-validator==1.0.8
Facing same issue with another cron schedule - 10-20,50-55 0-6 * * *.
I think it doesn't validate when there is a list of ranges or list of range and specific