Delete directories without browsing them

AZ 9901 az9901 at gmail.com
Sun Apr 7 03:25:49 MDT 2013


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 ?
> 
> No.
> 
> 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 ?

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 :-)

Thank you very much !

Ben



More information about the rsync mailing list