<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><div>A couple of ideas.</div><div><br></div><div>The KC recommends adding <span style="font-family:"IBM Plex Mono",Menlo,"DejaVu Sans Mono","Bitstream Vera Sans Mono",Courier,monospace;font-size:0.75rem;font-style:inherit;font-variant-caps:inherit;letter-spacing:0.32px;color:rgb(22,22,22);background-color:rgb(244,244,244)">WEIGHT(DIRECTORY_HASH) to group deletions within a directory. Then maybe also do it as a 2-step process, in the same policy run. Where you delete all non-directories first, and then deletes the directories in a depth-first order using WEIGTH(Length(PATH_NAME)):</span></div><div><span style="font-family:"IBM Plex Mono",Menlo,"DejaVu Sans Mono","Bitstream Vera Sans Mono",Courier,monospace;font-size:0.75rem;font-style:inherit;font-variant-caps:inherit;letter-spacing:0.32px;color:rgb(22,22,22);background-color:rgb(244,244,244)"><br></span></div><div><br></div><div>RULE 'delnondir' DELETE</div><div>     <span style="font-family:"IBM Plex Mono",Menlo,"DejaVu Sans Mono","Bitstream Vera Sans Mono",Courier,monospace;font-size:0.75rem;font-style:inherit;font-variant-caps:inherit;letter-spacing:0.32px;color:rgb(22,22,22);background-color:rgb(244,244,244)">WEIGHT(DIRECTORY_HASH)</span><br>     DIRECTORIES_PLUS<br>     WHERE PATH_NAME LIKE '/mypath/%' AND NOT MISC_ATTRIBUTES LIKE '%D%'<br></div><div><br></div><div>RULE 'deldir' DELETE<br>     DIRECTORIES_PLUS</div><div>    WEIGHT(Length(PATH_NAME))<br>     WHERE PATH_NAME LIKE '/mypath/%' <span style="color:rgb(0,0,0);font-family:-webkit-standard;font-size:medium"> AND </span><span style="color:rgb(0,0,0);font-family:-webkit-standard;font-size:medium">MISC_ATTRIBUTES LIKE '%D%'</span><br></div><div><br></div><div>HTH</div><div><span style="color:rgb(0,0,0);font-family:-webkit-standard;font-size:medium"><br></span></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 20, 2021 at 1:18 PM Ulrich Sibiller <<a href="mailto:u.sibiller@science-computing.de">u.sibiller@science-computing.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
Hello *,<br>
<br>
I have to delete a subtree of about ~50 million files in thousands of subdirs, ~14TB of data. <br>
Running a recursive rm is very slow so I setup a simple policy file:<br>
<br>
RULE 'delstuff' DELETE<br>
     DIRECTORIES_PLUS<br>
     WHERE PATH_NAME LIKE '/mypath/%'<br>
<br>
This kinda works but is not really fast, either. It even requires a second run because files and <br>
directories within the tree will be processed in arbitrary order so it will happen quite frequently <br>
that a directory is going to be deleted before its content has been removed completely. For those <br>
dirs I see an error message and have to delete afterwards.<br>
<br>
I am wondering if there's a quicker way. Given the fact that this is a whole tree I think there's <br>
should be a quick way to unlink the complete inode hierachy.<br>
<br>
Unfortunately we are not using a fileset for that tree...<br>
<br>
So are there any ideas how to solve that more efficiently?<br>
<br>
Uli<br>
-- <br>
Science + Computing AG<br>
Vorstandsvorsitzender/Chairman of the board of management:<br>
Dr. Martin Matzke<br>
Vorstand/Board of Management:<br>
Matthias Schempp, Sabine Hohenstein<br>
Vorsitzender des Aufsichtsrats/<br>
Chairman of the Supervisory Board:<br>
Philippe Miltin<br>
Aufsichtsrat/Supervisory Board:<br>
Martin Wibbe, Ursula Morgenstern<br>
Sitz/Registered Office: Tuebingen<br>
Registergericht/Registration Court: Stuttgart<br>
Registernummer/Commercial Register No.: HRB 382196<br>
_______________________________________________<br>
gpfsug-discuss mailing list<br>
gpfsug-discuss at <a href="http://spectrumscale.org" rel="noreferrer" target="_blank">spectrumscale.org</a><br>
<a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss" rel="noreferrer" target="_blank">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a><br>
</blockquote></div>