fhg
Volume 11, Number 16 -- May 18, 2011

Admin Alert: Running System i Cleanup Manually

Published: May 18, 2011

by Joe Hertvik

A reader recently wrote me inquiring about some of the finer points in running the i operating system's cleanup tasks for clearing out messages, job logs, and other system output. While IBM offers a decent automated cleanup function, it's not quite as clear how to manually run the cleanup option. This week, I'll review what cleanup tasks do and show you how to run this function either automatically or manually.

What Are the Cleanup Tasks?

Cleanup is an i operating system task for manually or automatically cleaning up user messages; system and workstation messages; system journals, job logs and log files; and other system output. Many administrators automatically run the cleanup jobs every night but the jobs can also be run manually or inside an automated job scheduler. To view the cleanup task options on your system, bring up the Cleanup Tasks menu by typing in the following Go to Menu (GO) command on a green screen command line.

GO MENU(CLEANUP)

You'll see a screen that looks something like this.



Select option 1, Change Cleanup Options, and you'll see the following Change Cleanup Options screen.



The cleanup options are fairly straightforward. If you want the system to automatically run cleanup every night, put a 'Y' in the allow automatic cleanup option and specify the time you want the cleanup jobs to run. The rest of the options deal with how many days worth of each type of system output you want to keep after cleanup completes (i.e., user and system messages, job logs, spooled file output, etc.). If you opt for automatic cleanup, the cleanup job will run every night.

What's Wrong With Automatically Running Cleanup?

Unfortunately, because of nightly schedules, backups, system traffic, or other issues, not everyone wants to run system cleanup every night. And there isn't any system option to run cleanup on a staggered schedule where it runs at different times each night or executes as a reactive job that runs after another job completes.

To change the cleanup tasks to run on a different schedule, you have two choices:

1. You can start the cleanup job manually. Or. . .

2. You can insert the cleanup tasks into your job scheduler to run either as a scheduled job on certain nights of the week or as a reactive job after a critical companion job such as a nightly backup finishes.

Here's the lowdown on how to run either option.

The Key To Running Cleanup Manually or Inside a Job Scheduler

You can run cleanup tasks manually by executing the following Start Cleanup (STRCLNUP) command on a command line.

STRCLNUP OPTION(*IMMED)

However, if your system is already set to run system cleanup automatically each night, you may receive the following message.

Cleanup has already been started or is scheduled to run.

And the command will not run. In order to run the STRCLNUP command manually or in a job scheduler, you have to configure your cleanup options in a specific way. To do this, go into option 1, Change Cleanup Options, on the Cleanup Tasks menu and make the following changes.

  1. Set the allow automatic cleanup parameter to 'Y'. You won't be able to run STRCLNUP if this parameter is set to N.
  2. Set the time cleanup starts each day parameter to *NONE. STRCLNUP will not run manually or inside a job scheduler if there is a scheduled time in this parameter.

After these parameters are set correctly, you will be able to run STRCLNUP manually by executing STRCLNUP from a command line or inside a job scheduler entry.

Running STRCLNUP From Your Job Scheduler

After you make the changes that allow STRCLNUP to manually run, you will then be able to run it from a job scheduler such as IBM's job scheduler or Help/Systems' Robot/SCHEDULE. The reason you might want to use a job scheduler instead of the automatic cleanup function is that you may not want cleanup to run at the same time every night. Some nights, you may want to run it at 10 p.m., on Sunday mornings you may want to run at 3 a.m., and on other nights you may not want to run it at all. You can't do that with the automated cleanup schedule, which runs it at the same time every day. For that, you have to turn to a scheduling program.

The first step is to add an entry to your job scheduler for the days you want cleanup to run. Set up your scheduler entry so that it submits the STRCLNUP command as shown here.

STRCLNUP OPTION(*IMMED)

Once you set up your entry, cleanup will run according to the schedule you've created.

However, if you want cleanup to run as a reactive job that only runs after another job finishes, you have two choices.

1. If you're running Robot/SCHEDULE, you can designate it as a reactive job. SCHEDULE has a reactive job function where your job will be submitted only after its designated companion job completes.

2. If you don't have reactive job capability in your scheduler, you can set up your job entry to submit both the cleanup job and the reactive job to a single-threaded job queue. A single-threaded queue will only run one job at a time. So if you submit the companion job first to the queue followed by the cleanup job, the cleanup job will not run until the companion job finishes executing, which is exactly what a reactive job does when it waits for its companion job to complete before starting.

But there is one other trick to sending your cleanup job to a specific single threaded job queue. By default, i operating system cleanup jobs run in the QCTL job queue, which feeds into the QCTL subsystem. For some strange reason, this job queue is not changeable through option 1 (Change Cleanup Options) on the Cleanup Tasks menu. Rather, you need to use the Change Cleanup (CHGCLNUP) command as follows to change the job queue that your system cleanup jobs are submitted to.



On this screen, change the job queue and library name parameters to the single-threaded job queue that you want to submit your cleanup jobs to. By doing this, you are enabling your cleanup tasks to run immediately after its companion job finishes, creating a reactive job situation.

And that's how you set up your operating system cleanup tasks to run automatically inside your job scheduler software on a staggered schedule or as a reactive job.

Correction: When Do SMTP Server Changes Take Effect?

In a recent article on configuring SMTP retry parameters, I mentioned that SMTP server parameter changes take effect immediately. That was a wrong statement. Reader Rich Grega wrote in to remind me that any SMTP server changes take effect the next time the server is started. So take note to restart your SMTP server after changing any parameters.

You can restart SMTP from the green screen by using the following green screen End TCP/IP Server (ENDTCPSVR) and Start TCP/IP Server (STRTCPSVR) commands.

ENDTCPSVR SERVER(*SMTP)
STRTCPSVR SERVER(*SMTP)

To restart SMTP in System i Navigator (OpsNav), open the Network→Servers→TCP/IP node. In the right-hand pane that appears, right-click on the SMTP entry and click stop from the pop-up menu that appears. After the server status changes to stopped, right-click on the SMTP entry and this time click start from the pop-up menu.

Your changes will become active after the server restarts, as Rich noted.


RELATED STORY

Why is my i/OS Email Coming Back Undeliverable?



                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
BOTZ & ASSOCIATES, INC.

Free 1-Hour Security Consultation
with Patrick Botz

                                                 Need advice you can trust on security audits,
                                                 PCI, HIPAA or SOX requirements, 3rd party
                                                 software, rational password management,
                                                 public authority or Security Level 40?

                                                 Spend an hour with Patrick Botz - FREE -
                                                 and get actionable info and tips
to get you
                                                 started. Custom, 100% independent advice

                                                 from the guy who helped architect Power
                                                 Systems / IBM i security.

                                                 Click to set up your free session with Pat.
                                                 World-class security expertise is no longer just
                                                 for the big guys!


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Edwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

SEQUEL Software:  View the recorded Webinar: 10 Ways SEQUEL Makes Developers More Productive
CNX:  Ready to develop true Web 2.0 applications? Valence Version 3.0 BETA 1 is now available
looksoftware:  FREE Webcast: RPG Open Access Demystified. June 7 (Europe) & June 8 (USA)


 

IT Jungle Store Top Book Picks

BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

The iSeries Express Web Implementer's Guide: List Price, $49.95
The iSeries Pocket Database Guide: List Price, $59
The iSeries Pocket SQL Guide: List Price, $59
The iSeries Pocket WebFacing Primer: List Price, $39
Migrating to WebSphere Express for iSeries: List Price, $49
Getting Started with WebSphere Express for iSeries: List Price, $49
The All-Everything Operating System: List Price, $35
The Best Joomla! Tutorial Ever!: List Price, $19.95


 
The Four Hundred
Q&A With Power Systems Top Brass, Part Two

DR Plans Keep Bad Things from Happening to Good Companies

IBM Gets Tape Ready for 'Big Data'

Mad Dog 21/21: Ptolemy And Shorter You

looksoftware Looks Ahead

Four Hundred Stuff
SMA Comes Out of the Blue with IT Automation Tools

looksoftware Expanding RPG Open Access Use

CNX Goes Mobile with Valence 3.0

Bsafe Changes Name to Enforcive, Updates IBM i Security Suite

Rapid Data Recovery on a Budget

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
September 25, 2010: Volume 12, Number 39

September 18, 2010: Volume 12, Number 38

September 11, 2010: Volume 12, Number 37

September 4, 2010: Volume 12, Number 36

August 28, 2010: Volume 12, Number 35

August 21, 2010: Volume 12, Number 34

TPM at The Register
VMware gets Go-ing with Shavlik buy

AMD chases servers with fanless FirePro GPU

Desktop OS revenue and growth outpace servers

Nvidia dollars lifted by Intel's Sandy Bridge ramp, payola

Cisco dollars pinched by cheap switches, vanishing cameras

Intel juices cash divvy – again

Galleon hedge fund founder convicted on all 14 counts

Unisys revs up big ClearPath mainframes

Akamai, Riverbed join forces to juice clouds

Ubuntu eats OpenStack for clouds

Clouds puff up Rackspace in Q1

Cisco taps ex-Sun chip guru for servers

THIS ISSUE SPONSORED BY:

WorksRight Software
CNX
Botz & Associates, Inc.


Printer Friendly Version


TABLE OF CONTENTS
An Introduction to Python on IBM i, Part 3

The Case of the Missing Logical File

Admin Alert: Running System i Cleanup Manually

Four Hundred Guru

BACK ISSUES




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2011 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement