Configure database clean-up for the News repositoryEdit settings in the news-config.xml file to define the interval at which the databaseCleanup task runs and specify when the IBM WAS scheduler starts the task.
Before you beginTo edit configuration files, use the WAS wsadmin client. See Starting the wsadmin client for details.
About this taskThe databaseCleanup task ensures that news stories are periodically removed from the News repository. You can update the following properties for this task:
Enables or disables the database cleanup task. This property takes a Boolean value, true or false. The value must be formatted in lowercase.
Specifies the interval at which the database cleanup task runs. This property is a string value that must be specified in Cron format. For more information about the Cron schedule, see Scheduling tasks.
ProcedureTo configure the databaseCleanup task...
- From the dmgr host:
If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, pick the node where the file is stored.
- Check out the News cell-level configuration file using the following command:
- <working_dir> is the temporary directory to which you want to check out the cell-level configuration file. This directory must exist on the server where you are running wsadmin.
Note: AIX and Linux only: The directory must grant write permissions or the command will not run successfully.
- <cellName> is the name of the cell that the home page node belongs to. This argument is required. It is also case-sensitive, so type it with care. If you do not know the cell name, type the following command in the wsadmin command processor to determine it:
The command displays this message:
News Cell Level configuration file successfully checked out.
Open news-config.xml in a text editor. Locate the section containing the databaseCleanup task and make the necessary changes.
For example, the following code specifies that the News data clean-up task is enabled and runs every day exactly at 23 hours.
<task name="NewsDataCleanup" description="Job to clean up the news" interval="0 0 23 ? * *" startby="" enabled="true" scope="cluster" type="internal" targetName="ScheduledTaskService" mbeanMethodName="" serverName="unsupported" > </task>
Use the <databaseCleanup> element to specify the interval at which news stories are deleted from the News repository.
For example, the following code specifies that news stories are deleted from the database when they are more than 30 days old.
<databaseCleanup> <storyLifetimeInDays>30</storyLifetimeInDays> </databaseCleanup>
Note: Do not disable the databaseCleanup setting. If you disable it, you run the risk of rapidly reaching your file system storage limit as the database increases in size. Disabling this setting can also result in poor data access performance.
After making changes, check the configuration files back in, and do so during the same wsadmin session in which you checked them out for the changes to take effect. See Apply property changes in the News repository for information about how to save and apply your changes.
Parent topicAdminister the News repository
Apply property changes in the News repository
Access the News configuration file
Manage scheduled tasks for the News repository