Automated Cleanup of Print Files, Work Files, and Other Files

Use this procedure to clean up print files, work files, RQC files, user home directory files, and WebSphere trace and dump files by either running a program or by defining a recurring job that calls the program. Before running the program or the recurring job, you must set up configuration files. These files enable you to set the cleanup options, exclude specific files from the cleanup process (by file name or by the user name associated with the files), and to specify date ranges for the files to be deleted.

The types of files to be deleted include:

  • Completed job entries
  • Completed jobs forms and the associated job logs
  • Batch report files
  • All print files from the print manager
  • Files from $LAWDIR/productline/work directory
  • All user-related files from the $LAWDIR/RQC_work, $LAWDIR/RQC_work/log, $LAWDIR/RQC_work/cookies directories
  • WebSphere trace and dump (.dmp, .phd, javacore and .trc) files that are in subdirectories of the <WASHOME>/profiles directory.

To clean up print files, work files, RQC files, and other files:

  1. Configure the prtwrkcleanup.cfg file.

    You can edit the parameters in the prtwrkcleanup.cfg file in two ways:

    • By using the Lawson Portal Administration Tools. See Configuring Automated File Cleanup in the Lawson Portal Administration Guide, 10.1. (This option is only available in Lawson Portal 10.1.)
    • By directly editing the file in the $LAWDIR/system directory. See Directly Updating the prtwrkcleanup.cfg File.
  2. Configure the prtwrkcln_usrnames.cfg file.

    This configuration file is divided into multiple sections:

    • Section 1: usernames list for print and completed job cleanup
    • Section 2: usernames list for RQC cleanup
    • Section 3: usernames list for users home directory cleanup.

    The script uses each different section for a different cleanup job. Make sure to put usernames in the right sections to avoid undesired outcomes.

    You can enter multiple usernames in either a comma-separated format or a line-break-separated format.

    For example:

    Username1,Username2,Username3…

    Or

    Username1

    Username2

    Username3

    Note: Do not remove the section dividers.
  3. Configure the prtwrkcln_exclude.cfg file.

    Use this file to specify a list of file names to be excluded from the work file cleanup process.

    You can enter multiple file names in either a comma-separated format or a line-break-separated format.

    For example:

    Filename1,Filename2,Filename3…

    Or

    Filename1

    Filename2

    Filename3

  4. If you want to run the cleanup program just once, open a command line session and follow the substeps below. (Note that a recurring job may be more useful in the long term. See the next main step below.)
    1. Ensure that the prtwrkcln executable exists in $GENDIR/bin.
    2. In a command line session, navigate to $GENDIR/bin.
    3. At the command line, enter the following command:

      prtwrkcln.

  5. If you want to run the cleanup program via a recurring job, use the following substeps.
    1. In Lawson Portal, navigate to Bookmarks > Jobs and Reports > Multi-step Job Definition.
    2. Specify this information to define a multi-step job.
      Job Name
      Specify a name for the multi-step job.
      Job Description
      Specify a description for the multi-step job.
      User Name
      Displays the name of the user defining the job.
      Form
      Specify prtwrkcln. (This assumes this form ID exists. Use the For ID Definition utility (tokendef) to check if it exists and to add it as an environment form ID if necessary.)
      Step Description
      Specify a description for the step.
    3. Click Add to save the new job.
    4. Navigate to Related Forms > Recurring Job Definition. Define a recurring job according to the instructions in the "Recurring Jobs" topic in Infor Lawson Administration: Jobs and Reports.