[Contents] [Prev] [Next] [End]
A calendar consists of a sequence of time events defined using one or more time expressions. The happening of a time event associated with a calendar can trigger the execution of your production jobs. Calendars are defined and manipulated independently of jobs. This allows multiple jobs to share the same calendar. There are three types of calendars you can use to submit your job:
A calendar has a name, an owner (user), and a description. The name of the calendar1. and its owner are assigned when it is created. The current status of a calendar is determined by the status of time events associated with the calendar. A calendar is active if one or more of the associated time events are active and inactive if none of the associated time events is active.
A time event in JobScheduler consists of a starting time and duration in which the event remains active. The happening of a time event changes the status of calendar from inactive to active. Time events are defined using a time expression.
A time expression is a convenient syntax for defining time events. It is a string consisting of five mandatory fields used to control the starting time of an event and an optional field specifying the duration of an event. To prevent the shell from interpreting special characters, the time expression should be placed within quotes. A time expression has the following format:
year:month:day:hour:min[%duration]
The fields are defined as follows:
The values for the first five fields may be specified as follows:
There can be no space within a time expression.
*:*:*:12:0%30
1997:*:Mon-Fri:9-17:*
*:Mar,Jun,Sep,Dec:Mon[1],Tue[2],Wed[3],Thu[4],Fri[5]:23:30%1H
To specify complex or non-uniform events, several time expressions can be combined into a time expression list, with expressions separated by a space. The time expression list is used to generate the time events for a calendar.
*:*:*:12:0%30 *:Mar:Mon,Tue:22:30
Note
If a time expression list contains time expressions specifying overlapping events, then they are handled in such a way that the happening of a new event terminates a previous event that would otherwise still be active until the end of the duration.
You use the bcaladd command to create a new calendar in the system. Each calendar has a name, an optional description, and a time expression list defining the time events.
The time expression list is specified with the -t option. To prevent the shell from interpreting any blank or special characters, the time expression list should be placed within quotes.
The optional description is a string of text declared with the -d option. If the string contains blanks or special characters, it should be placed within quotes as well.
% bcaladd -d "Daily Calendar" -t "*:*:*:08:0%30" daily Calendar <daily> is created.
This creates a calendar named daily with the description 'Daily Calendar'. It is active every day at 8 a.m. for a period of 30 minutes.
You may find it more convenient to create your calendars using the GUI application, xbcal, as shown in Figure 6.
Each item in the 'Time Expression' area has an 'extras' button which leads to a further pop-up window. These pop-ups allow you to select the details for each field.
Figure 7 shows the resulting pop-up from clicking the button beside the Years item.
Clicking the button beside the Months item results in the pop-up shown in Figure 8.
Figure 9 shows the resulting pop-up from selecting the Days item. This pop-up has two separate windows. The first allows you to select days of the month. The second allows you to select days of the week. Selecting the 'Reverse' button reverses the meaning of the day selections. See 'Time Expression' for further details.
Clicking the button beside the Hours item results in the pop-up shown in Figure 10.
Figure 11 shows the resulting pop-up from selecting the button beside the Minutes item.
The last pop-up is the Duration window, shown in Figure 12.
You can display all the defined calendars by using the bcal command.
% bcal CALENDAR_NAME OWNER STATUS DURATION NEXT_EVENT_TIME Daily SYS inactive - Wed Dec 25 06:00:00 1996 Holiday SYS inactive - Wed Dec 25 00:00:00 1996 Midnight SYS inactive - Wed Dec 25 00:00:00 1996 daily user1 inactive - Wed Dec 25 08:00:00 1996 hourly user1 active 7 Tue Dec 24 16:00:00 1996 complex user1 inactive - Wed Dec 25 17:00:00 1996
The CALENDAR_NAME field lists the name of the calendar.
The OWNER field shows the user name of the calendar owner. By default, you will see all your calendars as well as the system calendars.
The STATUS field can be either active or inactive. If the current time is within a time event of the calendar, the status will be active; otherwise, it will be inactive.
The DURATION field of an inactive calendar is set to '-'. For an active calendar, this field indicates the time (in minutes) that the calendar will remain active.
The NEXT_EVENT_TIME field indicates the starting time for the next time event associated with the calendar.
You can use the -l option to display more detail about your calendars.
% bcal -l CALENDAR: daily -- Daily Calendar OWNER STATUS CREATION_TIME LAST_MODIFY_TIME user1 inactive Fri Dec 13 14:19:39 1996 Tue Dec 17 14:12:02 1996 TIME_EXPR_LIST: *:*:*:8:0%30 LAST_EVENT_TIME: <Tue Dec 24 08:00:00 1996> to <Tue Dec 24 08:30:00 1996> NEXT_EVENT_TIME: <Wed Dec 25 08:00:00 1996> to <Wed Dec 25 08:30:00 1996> ------------------------------------------------------------------------------- CALENDAR: hourly -- Hourly Thirty Minute Calendar OWNER STATUS CREATION_TIME LAST_MODIFY_TIME user1 active Mon Dec 16 15:18:18 1996 - TIME_EXPR_LIST: *:*:*:*:0%30 LAST_EVENT_TIME: <Tue Dec 24 15:00:00 1996> to <Tue Dec 24 15:30:00 1996> NEXT_EVENT_TIME: <Tue Dec 24 16:00:00 1996> to <Tue Dec 24 16:30:00 1996> ------------------------------------------------------------------------------- CALENDAR: complex -- Complicated Hourly Calendar OWNER STATUS CREATION_TIME LAST_MODIFY_TIME user1 inactive Tue Dec 17 14:26:55 1996 - TIME_EXPR_LIST: 1996:*:Mon[1],Mon[3],Mon[4],Tue[1],Tue[2],Tue[4],Tue[5],Wed[2] ,Wed[3],Wed[5],Thu[1],Thu[3],Thu[4],Fri[1],Fri[2],Fri[4],Fri[5]:17,21,23:*%1h LAST_EVENT_TIME: <Tue Dec 24 23:00:00 1996> to <Wed Dec 25 00:00:00 1996> NEXT_EVENT_TIME: <Thu Dec 26 17:00:00 1996> to <Thu Dec 26 18:00:00 1996>
By default, bcal shows all of your calendars plus all of the system calendars. See 'System Calendars' for more details. You can specify a calendar by name.
% bcal hourly CALENDAR_NAME OWNER STATUS DURATION NEXT_EVENT_TIME hourly user1 active 7 Tue Dec 24 16:00:00 1996
The -u user_name option displays calendars of the named user.
% bcal -u sysmgr CALENDAR_NAME OWNER STATUS DURATION NEXT_EVENT_TIME security sysmgr inactive - Tue Jan 01 00:10:00 1997
You can see the calendars of all users if you use the reserved name all.
System calendars are read-only calendars defined in the JobScheduler configuration by the cluster administrator. System calendars are owned by the virtual user SYS and can be viewed by everybody. You cannot modify or delete the system calendars.
System calendars can be used as normal calendars. When a system calendar is defined, its name becomes a reserved calendar name in the cluster.
Note
The calendar name is case sensitive. If a system calendar is named Daily, you can still create a calendar named daily. If you try to create a calendar with the same name as an existing calendar, the JobScheduler system will return an error.
When the JobScheduler daemons start, the system calendars are defined in the cluster.
You can use the xbcal GUI application to view the calendars as shown in Figure 13.
To view the details of a selected calendar, click 'Edit,' which then pops up a window showing the details of the calendar.
You can modify your calendars with the bcalmod command. This command allows you to change the description or time expressions associated with your calendar. Only the owner or an LSF administrator is allowed to modify a calendar.
% bcalmod -d "Daily Calendar @ 8:30" -t "*:*:*:08:30%30" daily Calendar <daily> is modified.
% bcal -l daily CALENDAR: daily -- Daily Calendar @ 8:30 OWNER STATUS CREATION_TIME LAST_MODIFY_TIME user1 inactive Fri Dec 13 14:19:39 1996 Tue Dec 24 16:13:02 1996 TIME_EXPR_LIST: *:*:*:8:30%30 LAST_EVENT_TIME: <Tue Dec 24 08:00:00 1996> to <Tue Dec 24 08:30:00 1996> NEXT_EVENT_TIME: <Wed Dec 25 08:30:00 1996> to <Wed Dec 25 09:00:00 1996>
Once you have modified a calendar, all jobs that depend on the modified calendar will be scheduled according to the new time events.
Note that you cannot modify the name of a calendar using bcalmod. To modify the name of a calendar, you need to delete the existing calendar and then create a new one with the desired calendar name.
A calendar can be modified using xbcal by first selecting the calendar to modify from the calendar listing window as shown in Figure 13, then click on the 'Edit' button . This will pop up a calendar edit window as shown in Figure 14.
After you have finished editing, choose 'Save' from the 'File' Menu, which commits the changes into the system.
Use the bcalhist command to display a history of events associated with the named calendars. These events include creation, modification and deletion.
% bcalhist daily Fri Dec 13 14:19:39: Calendar <daily@user1> created by user <user1>; Time expre ssion <*:*:*:8:*>, description <No description provided.>. Tue Dec 17 14:12:02: Calendar <daily@user1> modified by user or administrator < user1>; Time expression <*:*:*:8:*>, description <daily jo blist>. Wed Dec 18 15:13:00: Calendar <daily@user1> modified by user or administrator < user1>; Time expression <*:Aug,Sep,Oct:Tue,Thu,Sun:8:45%35 >, description <daily job list>. Wed Dec 18 16:35:11: Calendar <daily@user1> modified by user or administrator < user1>; Time expression <*:*:*:8:45%30m>, description <Dai ly Calendar @ 8:45>.
Notice the format of the calendar name in the output. You can display the history of another user's calendar by specifying calendar_name@user_name. By default, bcalhist displays only the history of your calendars.
Note
You can not display the history of system calendars. They are read-only calendars and have no modification history.
Calendars can also be deleted. The bcaldel command removes the named calendars from the system. Only the owner or an LSF administrator is allowed to remove a calendar.
% bcaldel daily Calendar <daily> is deleted.
% bcal daily daily: Bad calendar name
% bcalhist daily Fri Dec 13 14:19:39: Calendar <daily@user1> created by user <user1>; Time expre ssion <*:*:*:8:*>, description <No description provided.>. Tue Dec 17 14:12:02: Calendar <daily@user1> modified by user or administrator < user1>; Time expression <*:*:*:8:*>, description <daily jo b list>. Wed Dec 18 15:13:00: Calendar <daily@user1> modified by user or administrator < user1>; Time expression <*:Aug,Sep,Oct:Tue,Thu,Sun:8:45%35 >, description <daily job list>. Wed Dec 18 16:35:11: Calendar <daily@user1> modified by user or administrator < user1>; Time expression <*:*:*:8:45%30m>, description <Dai ly Calendar @ 8:45>. Fri Dec 20 08:53:44: Calendar <daily@user1> deleted by user or administrator <u ser1>.
You can delete a calendar using the xbcal GUI application as shown in Figure 15.
Note
Jobs that are associated with a deleted calendar will never be dispatched. You can either delete these jobs, or modify them so that they no longer depend on the deleted calendar.
2. The unit indicators, D, H, and M, can be upper-case or lower-case characters.
Copyright © 1994-1997 Platform Computing Corporation.
All rights reserved.