Solved

Find large objects on IFS

Posted on 2013-01-24
2
2,579 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 35

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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