Solved

Find large objects on IFS

Posted on 2013-01-24
2
2,351 Views
Last Modified: 2013-01-24
Is there a way to list all the large files on the IFS for disk clean up purposes?
0
Comment
Question by:roosterup
2 Comments
 
LVL 4

Accepted Solution

by:
rward earned 250 total points
ID: 38814452
There are a couple ways you could go about this.  

The first way is to use the Disk Space collection tool built into OS/400.  In a 5250 session type command: GO DISKTASKS  then take option 1 to collect all disk information.  Once the information has been collected you can use the 2nd option to print the information.  Select the type of report to print as Specific Object then select the object type as *STMF and set the smallest size in bytes you want to list on the report.  

Another way to list files greater than a certain size is to use a shell command.  In 5250 session enter command QSH then use the find command:

find / -type f -size +100000 -exec ls -lrt {} \;|sort -r +4

This will find all files from the root down that are larger than 100000 512bytes blocks and sort the list from largest size to smallest.  You can further use the redirect > to redirect the std output to a text file.

Rob
0
 
LVL 34

Assisted Solution

by:Gary Patterson
Gary Patterson earned 250 total points
ID: 38815484
IBM support article:

http://www-912.ibm.com/s_dir/slkbase.nsf/1ac66549a21402188625680b0002037e/c5f9378a8534995b86256ea000567c97?OpenDocument&Highlight=2,343071214

Good thread on the subject:

http://serverfault.com/questions/77405/how-to-efficiently-find-which-folders-are-filling-the-hard-disk-os-400

If you have PASE installed on your AS/400, you can use the AIX "du" command to find large IFS objects:

For each directory you want to scan (don't start in the root folder):

CALL QP2TERM
> cd /QOpenSys (or whatever folder you want to scan)
> du -a -k | sort -n -r | head -n 20

I'd usually repeat this for all the root-level IFS directories except for QOPT, QSYS.LIB, QFileSvr.400, and QNTC.
 
That will run the du command for the current folder, sort the output, and list the top 20 largest files or directories found.  Directory sizes are recursive, meaning it shows the sum of all the files in that directory and all subdirectories.

Sizes reflect actual disk consumption, and the "-k" option reports in kilobytes.

If you aren't familiar with PASE, it is an AIX execution environment that runs under OS/400 (i5/OS, iOS, i).  Here's info about PASE and qshell (BASH-like command shell for the AS/400):

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Frzahg%2Frzahgshell.htm

And here is a link to the AIX "du" command docs:

http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds2%2Fdu.htm

- Gary Patterson
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now