Sun Java System Messaging Server 6.3 Administration Guide

20.9.2.3 To Schedule Automatic Message Removal and Logging Level

Automatic message removal is activated by the imsched scheduling daemon. By default, imsched invokes imexpire at 23:00 every day and messages are both expunged and purged. This schedule can be customized by setting the configutil parameter local.schedule.expire and store.cleanupage described in Table 20–10.

Expire and purge can take a long time to complete on a large message store, so you may wish to experiment and decide how often to run these processes. For example, if an expire/purge cycle takes 10 hours, you may not want the default schedule of running expire and purge once a day. Schedule expire and purge using the imexpire command and the automatic task scheduling parameter (see4.6 To Schedule Automatic Tasks). For example:


configutil -o local.schedule.expire -v "0 1 * * 6 /opt/SUNWmsgsr/sbin/imexpire -e"
configutil -o local.schedule.mspurge -v "0 23 * * * /opt/SUNWmsgsr/sbin/imexpire -c"

In this example, messages are expired at 1AM Saturdays and purged every night at 11PM. If no purge schedule is set, , imexpire will perform purge after an expire.

Table 20–10 Expire and Purge configutil Log and Scheduling Parameters

Parameter  

Description 

local.schedule.expire

Interval for running imexpire. Uses UNIX crontab format: minute hour day-of-month month-of-year day-of-week

The values are separated by a space or tab and can be 0-59, 0-23, 1-31, 1-12 and 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, however, it is not typical to use them both since the number of such occurrences are very small. If they are both specified, then both will be required. For example, setting the 17th day of the month and Tuesday will require both values to be true. 

Note that you can also use the -e and -c flags with imexpire to and expire only or purge only respectively. See imexpire in Sun Java System Messaging Server 6.3 Administration Reference.

Interval Examples:

1) Run imexpire at 12:30am, 8:30am, and 4:30pm:

30 0,8,16 * * * /opt/SUNWmsgsr/sbin/imexpire

2) Run imexpire at weekday morning at 3:15 am:

15 3 * * 1-5 /opt/SUNWmsgsr/sbin/imexpire

3) Run imexpire only on Mondays:

0 0 * * 1 /opt/SUNWmsgsr/sbin/imexpire

Default:  

0 23 * * * /opt/SUNWmsgsr/sbin/imexpire

To disable: set local.schedule.expire.enable to NO.

store.cleanupage

Age (in hours) of expired or expunged message before purge will permanently remove it.

Default: None 

local.store.expire.loglevel

Specify a log level: 

1 = log summary for the entire expire session.  

2 = log one message per mailbox expired.  

3 = log one message per message expired. 

Default: 1 

Setting imexpire Logging Levels

imexpire will log a summary to the default log file upon completion. If expire is invoked from the command line, the -v (verbose) and -d (debug) option can be used to instruct imexpire to log detail status/debug messages to stderr. If imexpire is invoked by imsched, the configutil parameter local.store.expire.loglevel can be set to 1,2 or 3 for different levels of logging. Loglevel 1 is the default, it will log a summary for the entire expire session. Loglevel 2 will log one message per mailbox expired. Loglevel 3 will log one message per message expired.

Excluding Specified Users from Automatic Message Remove

Exclude specified users from the expire rules by adding their user ID, one per line, in a file called expire_exclude_list in msg-svr-base/config/. Or, configure a dummy exclusive expire rule under the user's mailbox.