+

Search Tips   |   Advanced Search

Manage scheduled tasks for the News repository


Overview

We can use the NewsScheduler commands to pause and resume the scheduled tasks for the News repository, and to retrieve information about tasks. The scheduling information is contained in news-config.xml.

SystemOut.log also contains information about whether the scheduler is running and whether any scheduled tasks have started. Log messages for the news service have the prefix CLFWX in SystemOut.log.

The News repository uses the scheduling service to perform regular managed tasks.


Manage a scheduled task

  1. Access the News configuration file:

  2. Administer the scheduler service for the News repository.

    NewsScheduler.getTaskDetails(java.lang.String taskName)

    Return information about the scheduled task specified by taskName.

    The values returned are server time, next scheduled run time, status (SCHEDULED, RUNNING, SUSPENDED), and task name. When the task has been paused, then the status parameter shows as SUSPENDED instead of SCHEDULED. SUSPENDED means the task is not scheduled to run.

    For example:

      NewsScheduler.getTaskDetails("NewsDataCleanup")

    The resulting output looks similar to the following:

    {taskName=NewsDataCleanup, currentServerTime=Fri Mar 12 14:42:25 GMT 2010, 
                               nextFireTime=Fri Mar 12 23:00:00 GMT 2010, 
                               status=SCHEDULED}

    NewsScheduler.pauseSchedulingTask(java.lang.String taskName)

    Temporarily pause the specified task and stops it from running.

    When you pause a scheduled task, the task remains in the suspended state even after you stop and restart News or the WAS. Run the NewsScheduler.resumeSchedulingTask(String taskName) command to get the task running again.

    If the task is currently running, it continues to run but is not scheduled to run again. If the task is already suspended, this command has no effect. When the task is paused successfully, a 1 is returned to the wsadmin client. When the task is not paused successfully, a 0 is returned. For example:

      NewsScheduler.pauseSchedulingTask("NewsDataCleanup")

    NewsScheduler.resumeSchedulingTask(java.lang.String taskName)

    If the task is suspended, puts the task in the scheduled state. If the task is not suspended, this command has no effect. When a task is resumed, it does not run immediately; it runs at the time when it is next scheduled to run. For example:

      NewsScheduler.resumeSchedulingTask("NewsDataCleanup")

    When the task is resumed successfully, a 1 is returned to the wsadmin client. When the task is not resumed successfully, a 0 is returned.


Parent topic:
Administer the News repository


Related:
Scheduling tasks
IBM Connections log file
Configure database clean-up for the News repository
Access the News configuration file
News administrative commands