Configure database clean-up for the News repository 

Edit 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 starting

To edit configuration files, use the WAS wsadmin client. See Starting the wsadmin client for details.


About this task

The databaseCleanup task ensures that news stories are periodically removed from the News repository. You can update the following properties for this task:

enabled

interval


Procedure

To configure the databaseCleanup task...

  1. From the dmgr host:

      cd $DMGR_PROFILE/bin
      ./wsadmin.sh -jython
      execfile("newsAdmin.py")

      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.

  2. Check out the News cell-level configuration file using the following command:

      NewsCellConfig.checkOutConfig("<working_dir>", "<cellName>")

      where:

      • <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:

          print AdminControl.getCell()

      For example:

      NewsCellConfig.checkOutConfig("d:/temp", "NewsServerNode01Cell")

      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 topic

    Administer the News repository


    Related tasks


    Apply property changes in the News repository
    Access the News configuration file
    Manage scheduled tasks for the News repository


       

     

    });

    +

    Search Tips   |   Advanced Search