rsync is not deleting subdirectories

mike mitchell supereffinyawn at gmail.com
Sat Aug 14 04:16:29 MDT 2010


On Sat, Aug 14, 2010 at 3:04 AM, Matt McCutchen <matt at mattmccutchen.net> wrote:
> On Fri, 2010-08-13 at 14:04 -0400, mike mitchell wrote:
>> Hi. I'm having a problem with rsync not deleting subdirectories that
>> exist at the destination but which have been removed/renamed on the
>> source. I'm running 64-bit Arch, rsync 3.0.7, and am trying to back up
>> /home to an external USB drive. Both drives are JFS. Example, where
>> /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/ is the mount point for
>> the external drive on which a back-up already exists:
>>
>> mike at robots mike]$ pwd
>> /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike
>> [mike at robots mike]$ mkdir deleteme1
>> [mike at robots mike]$ cd deleteme1/
>> [mike at robots deleteme1]$ touch deleteme1.txt
>> [mike at robots deleteme1]$ cd ../Desktop
>> [mike at robots Desktop]$ mkdir deleteme2
>> [mike at robots Desktop]$ cd deleteme2/
>> [mike at robots deleteme2]$ touch deleteme2.txt
>> [mike at robots deleteme2]$ rsync -avn --delete /home/mike/
>> /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike | grep deletem
>> deleting deleteme1/deleteme1.txt
>> deleting deleteme1/
>> [mike at robots deleteme2]$
>>
>> What I would expect is for deleteme1 and 2 to both be deleted, but
>> rsync is not deleting directories outside of the top level of the
>> backup.
>
> Strange.  Can you reproduce the problem with a different source and
> destination?  Try increasing the verbosity to -vvv, and search the
> output for a line saying "delete_in_dir(Desktop)" (indicating that rsync
> is considering files in that directory for deletion) as well as any
> mention of the deletem* files.
>
> --
> Matt
>
>

Thanks for the reply, Matt. I wasn't able to reproduce the problem
from any other source or destination, even in nested subdirectories
within a directory in my home. It was only when using /home/mike as
the source, so I guessed there must be something wrong in there. From
what I could tell by looking through the verbose output, there's a
directory, /home/mike/.subversion/auth, which is owned by root and
which I have no read access to (I think yaourt created it). Once rsync
would hit that, it seems like would just give up on deleting anything
else for the rest of the process?

I guess that's the case, because I'm excluding the .subversion
directory and it seems to be working correctly now. Kind of a dumb
thing on my part, sorry about that. But you definitely guided me in
the right direction to figuring out what I was doing wrong, so thanks!


More information about the rsync mailing list