This command-line application parses a cron string and expands each field to show the times at which it will run.
- Prerequisites
- Getting Started
- Usage
- Example
- Development
- Testing
- Future Improvements
- Contributing
- License
- Java Development Kit (JDK) 8 or above
- Command-line interface (Terminal, Command Prompt, etc.)
- Clone the repository: git clone <repository_url>
- Navigate to the project directory
Run the application with the following command:
java CronExpression <cron_string>
Replace <cron_string> with your desired cron expression enclosed in quotes.
To expand a cron expression, run the command:
java CronExpression "*/15 0 1,15 * 1-5 /usr/bin/find"
This will produce the following output:
minute 0 15 30 45
hour 0
day of month 1 15
month 1 2 3 4 5 6 7 8 9 10 11 12
day of week 1 2 3 4 5
command /usr/bin/find
You can import the project into your preferred Java development environment (e.g., IntelliJ, Eclipse) to make modifications or extend the functionality. The main logic for parsing and expanding the cron expression is implemented in the BaseParser.java class. This class is etended by other classes.
The project includes unit tests to ensure the correctness of the parsing and expansion logic. You can run the tests in your preferred Java development environment.
- Handle special time strings such as "@yearly"
- Provide support for additional cron expression features
- Improve error handling and validation for invalid input
- Add support for different output formats