--delete bug?

Joost Ruijsch joost at joost.a-1.nl
Sun Apr 27 22:16:32 EST 2003

Joost Ruijsch wrote:

> I have a script that does a weekly backup on a local backup harddrive 
> with the following command:
> # rsync -aRxW --delete / /mnt/backup
> Today I got errors because the target drive was full. It appeared 
> nothing on the targed drive ever got deleted.
> When I used the following command to backup only my home dir, it 
> worked as it should.
> # rsync -aRxW --delete /home/joost /mnt/backup
> Using rsync 2.5.6,  but I have the same problem on another machine 
> with rsync 2.4.6. Both use reiserfs.
> Does the delete option not work when source is '/' ?
> Joost.

I found this comment in flist.c :

if ((l == 2) && (fname[0] == '.')) {             
        /*  Turn ./ into just . rather than ./.  
           This was put in to avoid a problem with
           rsync -aR --delete from ./            
           The send_file_name() below of ./ was  
           mysteriously preventing deletes */    
        fname[1] = 0;                            
} else {                                         
        strlcat(fname, ".", MAXPATHLEN);         

This seems to be a workaround for a similar bug. The mystery deepens...
With some experimenting I found something that does work, using a double 
slash instead of a single:
# rsync -aRxW --delete // /mnt/backup


More information about the rsync mailing list