Skip to content

Prashant-Kumar700/CronExpression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cron Expression Parser

This command-line application parses a cron string and expands each field to show the times at which it will run.

Table of Contents

  • Prerequisites
  • Getting Started
  • Usage
  • Example
  • Development
  • Testing
  • Future Improvements
  • Contributing
  • License

Prerequisites

  • Java Development Kit (JDK) 8 or above
  • Command-line interface (Terminal, Command Prompt, etc.)

Getting Started

  1. Clone the repository: git clone <repository_url>
  2. Navigate to the project directory

Usage

Run the application with the following command:

java CronExpression <cron_string>

Replace <cron_string> with your desired cron expression enclosed in quotes.

Example

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

Development

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.

Testing

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.

Future Improvements

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages