Chronical Cron Job parameter in Java

I am very new to Java. As my first project, I am going to work with the cron task scheduler. I want clarifications on planning. I have a code that will run every hour.

  CronTrigger ct = new CronTrigger("cronTrigger", "group2", "0 1/0 * * * ?"); 

I read the planning documents, but I'm confused

In one document I read as below

 ("0 0 * * * ?") 
  • 1st 0 indicates seconds
  • 2nd indicates minutes
  • 3rd hour
  • During the 4th day of the month
  • 5th this month.

In some document I read that 1st indicates minutes of 2nd, etc.

Can someone explain this to me (0 1/0 * * *?), And also what does it mean (1/0)?

And I want to run the work every six hours.

If I give this ( 0 */6 * * * ?), will it work every six hours?

+4
1

crontab.guru, :

*   * * * *
* 1/0 * * *

, X/Y : X, Y. X + Yn. , */2, 2 .

: 1/0 " 1, ", 1 23, * 0 23.

, */6 6 , 0, 6, 12 18.

, 6- ?, , :

, CronExpression, : , , , , , . Cron , , , , . () , , *.

, ,

 +---------------- minute (0 - 59)
 |  +------------- hour (0 - 23)
 |  |  +---------- day of month (1 - 31)
 |  |  |  +------- month (1 - 12)
 |  |  |  |  +---- day of week (0 - 6) (Sunday=0 or 7)
 |  |  |  |  |
 *  *  *  *  *  command to be executed 

Java

   +----------------- minute (0 - 59)
   |  +-------------- hour (0 - 23)
   |  |  +----------- day of month (1 - 31)
   |  |  |  +-------- month (1 - 12)
   |  |  |  |  +----- day of week (0 - 6) (Sunday=0 or 7)
 # |  |  |  |  |  +-- year                       <-- this is extra !!
   |  |  |  |  |  |
   *  *  *  *  *  * command to be executed 

, ?. , crontab.guru, :

? ()

, 5 , ? , .

+5

All Articles