Manage scheduled tasks for the News repository 

Use administrative commands to manage scheduled tasks for the News repository.


Before starting

To run administrative commands, use the wsadmin client. See Starting the wsadmin client for details.


About this task

The News repository has only one managed task, the NewsDataCleanup task, which ensures that news stories are periodically removed from the repository. For more information about the NewsDataCleanup task, see Configure database clean-up for the News repository. You can use the NewsScheduler commands to pause and resume the NewsDataCleanup task, and to retrieve information about the task. The scheduling information is contained in the news-config.xml file. The SystemOut.log file also contains information about whether the scheduler is running and whether any scheduled tasks have started.

The News repository uses the IBM WAS scheduling service for performing regular managed tasks. For more information about how the scheduler works, see Scheduling tasks.


Procedure

To manage a scheduled 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.

  • Use the following commands to administer the scheduler service for the News repository.

      NewsScheduler.getTaskDetails(java.lang.String taskName)

        Returns 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 that 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 pauses 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. You must 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 tasks


    Configure database clean-up for the News repository


       

     

    });

    +

    Search Tips   |   Advanced Search