Re: rsync is not deleting subdirectories

2010-08-14 Thread mike mitchell
On Sat, Aug 14, 2010 at 3:04 AM, Matt McCutchen m...@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:

 m...@robots mike]$ pwd
 /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike
 [m...@robots mike]$ mkdir deleteme1
 [m...@robots mike]$ cd deleteme1/
 [m...@robots deleteme1]$ touch deleteme1.txt
 [m...@robots deleteme1]$ cd ../Desktop
 [m...@robots Desktop]$ mkdir deleteme2
 [m...@robots Desktop]$ cd deleteme2/
 [m...@robots deleteme2]$ touch deleteme2.txt
 [m...@robots deleteme2]$ rsync -avn --delete /home/mike/
 /media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike | grep deletem
 deleting deleteme1/deleteme1.txt
 deleting deleteme1/
 [m...@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!
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


rsync is not deleting subdirectories

2010-08-13 Thread mike mitchell
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:

m...@robots mike]$ pwd
/media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike
[m...@robots mike]$ mkdir deleteme1
[m...@robots mike]$ cd deleteme1/
[m...@robots deleteme1]$ touch deleteme1.txt
[m...@robots deleteme1]$ cd ../Desktop
[m...@robots Desktop]$ mkdir deleteme2
[m...@robots Desktop]$ cd deleteme2/
[m...@robots deleteme2]$ touch deleteme2.txt
[m...@robots deleteme2]$ rsync -avn --delete /home/mike/
/media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike | grep deletem
deleting deleteme1/deleteme1.txt
deleting deleteme1/
[m...@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. For example, if I specify only the desktop, the second
directory I created above is deleted:

[m...@robots deleteme2]$ cd ../
[m...@robots Desktop]$ rsync -avn --delete /home/mike/Desktop/
/media/8c4d270d-6139-4fed-8a32-2df8d28acdf3/mike/Desktop | grep
deletem
deleting deleteme2/deleteme2.txt
deleting deleteme2/

I've also tried with --force and various forms of --delete
(--delete-after and so on). Before posting here I rtfm'd and confirmed
(hopefully) that my usage is correct. So, I apologize if I'm just
doing something wrong (but I'd appreciate being corrected).
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html