Solved

Find large objects on IFS

Posted on 2013-01-24
2
2,417 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Start QSH command from CL 19 1,004
as400 calendar 2 159
Access Remote iSeries IFS 6 285
ED710 -->  UADDMBX 10 240
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

895 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