Delete directories without browsing them
az9901 at gmail.com
Sun Apr 7 08:24:14 MDT 2013
Le 7 avr. 2013 à 13:29, Matthias Schniedermeyer a écrit :
> On 07.04.2013 11:25, AZ 9901 wrote:
>> Le 6 avr. 2013 à 17:15, Matthias Schniedermeyer a écrit :
>>> On 06.04.2013 16:57, AZ 9901 wrote:
>>>> Is there a way to tell Rsync to directly delete backup directories at
>>>> the top of the hierarchy without browsing them ?
>>> Deleting a directory-tree has to be done "file by file" and "directory
>>> by directory" there is no magic "remove that mountain of files"(*).
>> Matthias, thank you for your answer !
>> I made some tests, I created a directory with 300k files in it.
>> I deleted it with Rsync, then with rm command.
>> I did this test several times.
>> On my server, it took about 20 seconds with rm, about 40 seconds with Rsync.
>> In the Rsync deamon logfile, I can see a "del." line for each file of the directory, beginning from the top down.
>> Does Rsync compares each file against the incl/excl list to know if it can be deleted ?
> Unfortunatly i don't know.
>> If so, is there a way to tell Rsync the following ?
>> "delete this top directory and all its files, but stop lacking time with comparisons against the incl/excl list for each element of this top directory"
>> Certainly that it could speed up deletion with Rsync :-)
> Possibly it's just overhead that slows down rsync.
> rm only does deletion, rsync can do much more so the code-path are
Thank you Matthias !
Let's wait for Wayne's answer, he certainly knows :-)
More information about the rsync