This is a small python project that parses cron commands given as arguments and extends it to actual runtime information. This is very useful for reviewing cron commands prior to using them on a server.
This script was written in Python 3.9 but should run without issue on all Python3 versions.
- Clone this repo using the following command:
git clone https://github.com/deannotdin/PythonCronReview.git
- cd PythonCodeReview
- Run
./PCR "*/5 4-8 1,2,3 12 * echo hello world!"
- Profit!
- Days of the week can only be entered as a numerical value and not with short day name (such as SUN for sunday)
- Does not accept year values (not supported in all cron implementations)
- Weekdays are only accepted between 0-6. 7 isn't accepted, although it isn't accepted in all cron implementations.
- Sorting a given set of numbers separated by a comma.
- Add written text support for verification of months and days. For example, accepting DEC as the 12th month.
- I did not use PEP8 convention. Instead, I used some of my best practices.
- OOP could have been better written given more time.
- One example for that would be avoiding calling self.setInvalid() in cronParser.py and change logics to return INVALID even after a positive regex match, but with values that are invalid.
- Another example would be