Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Clean up IFS directories

Using the FIND utility in Qshell, one can easily delete, print reports of objects by last modified/accessed date.

Using the FIND utility in Qshell, one can easily delete, print reports of objects by last modified/accessed date(s), size, type, name, owner etc., In the example below I delete the directories that are more than a 1 GB size. This job runs daily as a scheduled job.

              PGM                                     DCL VAR(&QCMD) TYPE(*CHAR) LEN(256)    
 CHGVAR     VAR(&QCMD) VALUE(' find /tmp -size +2048000 + 
              -exec rm -r {} ;     ')                    
 QSH CMD(&QCMD)  
QSH CMD('exit')   
 ENDPGM  

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: Tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Read this Search400 Featured Topic: Managing your iSeries.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.


Dig Deeper on iSeries system performance and monitoring

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

I am running a QSHELL FIND command to remove objects from a subdirectory, however, the QSHELL job doesn't remove all and moves on to the next subdirectory. Here is the Find statement that I am using:

find /rendprt -type f -mtime +120 -print  | xargs rm

This statement should remove all objects that are over 120 days old in this subdirectory, which also has over 100 subdirectories of its own. When processing the QSHELL, the find skips around various subdirectories, but does not delete all of the objects that should be deleted. Am I doing something wrong or is this the way the QSHELL works?

Cancel

-ADS BY GOOGLE

SearchDataCenter

Close