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
Register today to access targeted resources from our editorial writers and independent industry experts including news, tips, and advice to help you do your job more efficiently and effectively. Stay informed on the hottest topics and biggest challenges faced by IT professionals working with iSeries products and services.
Requires Free Membership to View