Sun Java System Messaging Server 6 2005Q4 Administration Guide

To Schedule Automatic Tasks

Messaging Server provides a general task scheduling mechanism using a process called imsched. It is intended for scheduling the current version of Messaging Server processes. Scheduling non-current version of Messaging Server tasks is not supported. It is enabled by setting the local.schedule.taskname configutil parameter. If you modify the schedule, you must either restart the scheduler with the command stop-msg sched and start-msg sched, or you can refresh scheduler process (refresh sched).

This parameter requires a command and a schedule on which to execute the command. The format is as follows:

configutil -o local.schedule.taskname -v “schedule

taskname is a unique name for this command/schedule combination.

schedule has the format:

minute hour day-of-month month-of-year day-of-week command args

command args can be any Messaging Server command and its arguments. A fully qualified command pathname is required.

minute hour day-of-month month-of-year day-of-week is the schedule for running the command. It follows the UNIX crontab format.

The values are separated by a space or tab and can be 0-59, 0-23, 1-31, 1-12 or 0-6 (with 0=Sunday) respectively. Each time field can be either an asterisk (meaning all legal values), a list of comma-separated values, or a range of two values separated by a hyphen. Note that days can be specified by both day of the month and day of the week and both will be required if specified. For example, setting the 17th day of the month and Tuesday will only run the command on the 17th day of a month when it is Tuesday. See Table 18–10

Note that if you modify scheduler, you must either restart the scheduler with the command stop-msg sched and start-msg sched, or you can send SIGHUP to the scheduler process:

kill -HUP scheduler_pid

Scheduler Examples

Run imexpire in verbose mode at 12:30am, 8:30am, and 4:30pm:


configutil -o local.schedule.rm_messages -v “30 0,8,16 * * *” 
/opt/SUNWmsgsr/sbin/imexpire -v

Display MTA channel queue message counters every 20 minutes:


configutil -o local.schedule.counters -v “20,40,60 * * * *” 
/opt/SUNWmsgsr/sbin/imsimta qm counters -show > temp.txt

Run imsbackup Monday through Friday at midnight (12AM):


configutil -o local.schedule.msbackup -v “0 0 * * 1-5” 
/opt/SUNWmsgsr/sbin/imsbackup -f backupfile /primary