Manage Forums scheduled tasks 

Use the ForumsScheduler administrative commands to manage the tasks scheduled for forums.


Before starting

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


About this task

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

Forums has one managed task, the TrashAutoPurgeJob task, which removes deleted data from the Forums database. For more information about the TrashAutoPurgeJob task, see Purging forum trash. You can use the ForumsScheduler commands to pause and resume the TrashAutoPurgeJob task, and to retrieve information about the task. The scheduling information is contained in the forum-config.xml file. The SystemOut.log file also contains information about whether the scheduler is running and whether any scheduled tasks have started.


Procedure

To manage scheduled tasks for Forums...

  1. From the dmgr host:

      cd $DMGR_PROFILE/bin
      ./wsadmin.sh -jython
      execfile("forumsAdmin.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. Use the following commands to administer the Forums scheduler service.

      ForumsScheduler.getTaskDetails(String taskName)

        Returns information about the scheduled task specified by taskName. Forums currently has a single managed task – TrashAutoPurgeJob.

        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:

        ForumsScheduler.getTaskDetails("TrashAutoPurgeJob")

        The resulting output looks similar to the following:

        {currentServerTime=Wed Feb 03 14:21:47 EST 2010, nextFireTime=Sun Feb 07 02:00:00 EST 2010, status=SCHEDULED, taskName=TrashAutoPurgeJob}

      ForumsScheduler.pauseSchedulingTask(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 Forums or the IBM WAS. You need to run the ForumsScheduler.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.

        For example:

        ForumsScheduler.pauseSchedulingTask("TrashAutoPurgeJob")

        When a task is paused, a status message similar to the following is written to the SystemOut.log file:

         [2/3/10 14:28:10:782 EST] 0000002f ForumsNotific I   CLFWY0134I: Forums scheduled task 'TrashAutoPurgeJob' fired event 'TaskNotificationInfo.SUSPENDED'

      ForumsScheduler.resumeSchedulingTask(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:

        ForumsScheduler.resumeSchedulingTask("TrashAutoPurgeJob")

        Resuming a paused task causes the following status message to be written to the SystemOut.log file:

         [2/3/10 14:28:25:407 EST] 00000051 ForumsNotific I   CLFWY0134I: Forums scheduled task 'TrashAutoPurgeJob' fired event 'TaskNotificationInfo.RESUMED'


Parent topic

Administer Forums

Related concepts
Scheduling tasks


Related tasks


Purging forum trash on a schedule


   

 

});

+

Search Tips   |   Advanced Search