Crontab
The application implements a time-based job scheduler named Crontab. In crontab view, there is a set of jobs that are executed periodically at fixed times or intervals.
Typically automated application maintenance or administration is crontab jobs.
Crontab is shown in a table structure.
Name |
Expression |
Mime |
File name |
|
Last begin |
Last end |
Active |
Crontab parameters
Field | Description | Required |
---|---|---|
Name |
Job name. |
true |
Expression |
Sets when the job is executed. Takes into consideration the status of the application when the task will be executed. For example, if you stop the application at 00:00 to perform a backup, it delays the task until you consider the backup process will be completed. |
true |
Class name |
More information at Creating your own Crontab plugin. |
true |
|
When present, a mail is sent as part of the task once the execution has been completed. You can use several mail addresses using a comma "," as a separator. |
false |
Last begin |
Shows the last time a process started. |
- |
Last end |
Shows the last time a process was completed. |
- |
Active |
Enables or disables the process execution. |
true |
Understanding expression syntax
More information https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.htm
The commands are executed by cron when the minute, hour, and month fields match the current time, and when at least one of the two day fields (day of month, or day of week) match the current time. The scheduler examines crontab entries once every minute. The time and date fields are:
* * * * * * command to execute
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ????? day of week (MON, TUE, WED, THU, FRI, SAT, SUN)
? ? ? ? ?????????? month (1 - 12)
? ? ? ??????????????? day of month (1 - 31)
? ? ???????????????????? hour (0 - 23)
? ????????????????????????? min (0 - 59)
????????????????????????????? seconds (0 - 59)
Field | Values |
---|---|
seconds |
0-59 |
minute |
0-59 |
hour |
0-23 |
day of month |
1-31 |
month |
1-12 |
day of week |
MON, TUE, WED, THU, FRI, SAT, SUN |
Samples
"0 0 * * * *" = every hour of every day.
"*/10 * * * * *" = every ten seconds.
"0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
"0 0 6,19 * * *" = 6:00 AM and 7:00 PM every day.
"0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.
"0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
"0 0 0 25 12 ?" = every Christmas Day at midnight
Create a new crontab job
Crontab job is based in architecture.
More information at Creating your own Crontab plugin.
Edit a crontab job
- Click on
Edit crontab job icon.
- Modify the fields.
- Click on Edit button.
Execute a crontab job
- Click on
Execute crontab job icon
Delete a crontab job
Crontab job is based in plugin architecture deployed into $TOMCAT_HOME/plugins. Must delete the jar file in the plugin folder to remove the associated crontab job.