Don, this may be a bit of a longer resolution. I recently had to clean up many empty user
directories, folders, sub-folders.
2 suggestions:
First, there is a Window free utility WINDIRSTAT that will give you a look but it's slow and cumbersome.
Second, I used the EDTF '/' command.
Once it populates, put a 6 next to each DIR. It can be I/O intensive. I usually display several DIR's at a time.
From there you can drill down into each DIR and see where files live, if any and recursively delete.
I used this method and it took a few days to get through the cleanup but it worked well.
Kinda looks like this:
Directory: /
Position to : Record : 17 of
New File :
2=Edit 4=Delete File 5=Display 6=Path Size 9=Recursive Delete
Opt Name Size Owner Changed Used CCSID or Symbolic Link
BARWIDE *DIR QNOTES 08/09/19 23:36 01/31/21 13:16
Bytware *DIR STANDGUARD 08/09/19 23:36 01/31/21 13:22
CMOMembers *DIR AITMGRP 08/09/19 23:36 01/31/21 13:16
-------------------------------
Option 6 on Bytware
Directory: /
Position to : Record : 17 of
New File :
2=Edit 4=Delete File 5=Display 6=Path Size 9=Recursive Delete
Opt Name Size Owner Changed Used CCSID or Symbolic Link
BARWIDE *DIR QNOTES 08/09/19 23:36 01/31/21 13:16
Bytware 4,842K STANDGUARD 08/09/19 23:36 01/31/21 13:22 SUBDIRECTORIES = 6, FILES = 7
CMOMembers *DIR AITMGRP 08/09/19 23:36 01/31/21 13:16
--------------------------------
Opt 5 on Bytware
Directory: /Bytware
Position to : Record : 1 of 2
New File :
2=Edit 4=Delete File 5=Display 6=Path Size 9=Recursive Delete
Opt Name Size Owner Changed Used CCSID or Symbolic Link
MPLUS *DIR QSYS 02/16/17 15:16 01/31/21 13:26
StandGuard *DIR STANDGUARD 02/05/05 07:54 01/31/21 13:26
---------------------------------
Opt 6 on both DIR's
Directory: /Bytware
Position to : Record : 1 of 2
New File :
2=Edit 4=Delete File 5=Display 6=Path Size 9=Recursive Delete
Opt Name Size Owner Changed Used CCSID or Symbolic Link
MPLUS 4,818K QSYS 02/16/17 15:16 01/31/21 13:26 SUBDIRECTORIES = 3, FILES = 7
StandGuard 16K STANDGUARD 02/05/05 07:54 01/31/21 13:26 SUBDIRECTORIES = 1, FILES = 0
------------------------------
HTH .... MM
Very Respectfully,
Michael Mayer
IBM I on Power System Admin.
IT Operations.
The Florida Bar
651 E. Jefferson St
Tallahassee, Florida 32399-2300
mmayer@xxxxxxxxxxxxxx
https://www.floridabar.org
Office: 850.561.5761
Cell: 518.641.8906
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of midrange-l-request@xxxxxxxxxxxxxxxxxx
Sent: Sunday, January 31, 2021 1:00 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: MIDRANGE-L Digest, Vol 20, Issue 136
Send MIDRANGE-L mailing list submissions to
midrange-l@xxxxxxxxxxxxxxxxxx
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.midrange.com/mailman/listinfo/midrange-l
or, via email, send a message with subject or body 'help' to
midrange-l-request@xxxxxxxxxxxxxxxxxx
You can reach the person managing the list at
midrange-l-owner@xxxxxxxxxxxxxxxxxx
When replying, please edit your Subject line so it is more specific than "Re: Contents of MIDRANGE-L digest..."
*** NOTE: When replying to this digest message, PLEASE remove all text unrelated to your reply and change the subject line so it is meaningful.
Today's Topics:
1. Removing empty directories on the IFS (Don Brown via MIDRANGE-L)
----------------------------------------------------------------------
message: 1
date: Sun, 31 Jan 2021 17:41:35 +1000
from: Don Brown via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
subject: Removing empty directories on the IFS
I just completed a full system save on a system and there were over a million files in the IFS.
I now realise that the auto clean up was deleting files but not directories.
I now find the -empty option on the find tool is not available in IBMi in QSH
I have been using the find command as per the following example but it is only deleting files;
find /home -path '/home/*'
-type f -name '*.*' -mtime +90 -exec rm {} \;
I read that I can use -type d for directories but I still have not been able to get this to actually remove a directory.
I created the following directories
\test
\test\dir1
\test\dir1\file1.txt
\test\dir1\file2.txt
I then ran
find /test -path '/test/*'
-type f -name '*.*' -exec rm {} \;
And both of the files were deleted but the directories remained.
So I tried
find /test -path '/test/*'
-type d -name '*.*' -exec rm {} \;
And still the directories were not deleted.
System is V7R3 and PTF's updated 2 weeks ago.
Any suggestions gratefully accepted.
Thanks
Don
________________________________
Please note: Florida has very broad public records laws. Many written communications to or from The Florida Bar regarding Bar business may be considered public records, which must be made available to anyone upon request. Your e-mail communications may therefore be subject to public disclosure.
As an Amazon Associate we earn from qualifying purchases.