Skip to content

satwant007/CronJobParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cron Expression Overview

A cron expression is a string used to define a schedule for executing tasks, especially in UNIX-like systems. They are commonly used in cron jobs to specify the timing of script execution. Cron expressions are also used in various Java frameworks (like Spring) for scheduling tasks.

Structure of a Cron Expression

Cron expressions typically consist of five or six fields, separated by spaces, which represent different time intervals: Here is the breakdown of each field:

  1. Seconds: Specifies the second of the minute (0-59). Optional in most systems, but supported in some.
  2. Minutes: Specifies the minute of the hour (0-59).
  3. Hours: Specifies the hour of the day (0-23).
  4. Day of the Month: Specifies the day of the month (1-31).
  5. Month: Specifies the month (1-12).
  6. Day of the Week: Specifies the day of the week (0-7, where both 0 and 7 represent Sunday).

Special Characters of a Cron Expression

  1. * : Matches any value (e.g., every minute, every hour).
  2. , : Separates items in a list (e.g., "1,15" means at minutes 1 and 15).
  3. - : Specifies a range (e.g., "1-5" means Monday to Friday).
  4. / : Specifies an increment (e.g., "*/5" means every 5th minute).

Steps to use this application

  1. Clone the project in a local repo

  2. Open terminal in folder : /path/to/repo/CronJobParser

  3. Provide the cron expression and the command to be executed in the following format :

                     ./run_cron_parser.sh "Cron_Expression command"
    
         Example :   cd /path/to/folder/CronJobParser
                     ./run_cron_parser.sh
                  (Prompt)Enter the cron expression string:
                     */15 0 1,15 * 1-5 /usr/bin/find
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published