Re: --delete option does not always work
Hi, Wayne Davison [EMAIL PROTECTED] wrote: OK, I had a free moment to work up a fix, and here it is. It was pretty simple. I'm sorry to wake this up again, but it seems not to be so simple to fix at all :) I've stumbled over this while noticing that the rsnapshot backup of my root-filesystem simply never gets anything removed at all. So I made some tests: [EMAIL PROTECTED]:~# rsync --version | head -1 rsync version 2.6.8 protocol version 29 [EMAIL PROTECTED]:~# rsync -HSaxvn --delete --relative / /mnt/rsnapshot/daily.0/darkside/root | grep -c ^deleting 0 [EMAIL PROTECTED]:~# rsync -HSaxvn --delete / /mnt/rsnapshot/daily.0/darkside/root | grep -c ^deleting 264 [EMAIL PROTECTED]:~# cd / [EMAIL PROTECTED]:/# rsync -HSaxvn --delete --relative . /mnt/rsnapshot/daily.0/darkside/root | grep -c ^deleting 264 [EMAIL PROTECTED]:~# rsync -HSaxvn --delete --relative /. /mnt/rsnapshot/daily.0/darkside/root | grep -c ^deleting 0 As you can see, the only workaround that seems to work is cd / and using . then. However, this is not always possible, i.e. when rsyncing some.host:/ Of course, it would be simple to just avoid the --relative in this special case. But this is also not always possible, i.e. when using rsnapshot (:)) or - more serious - when rsyncing multiple sources at once like rsync -HSaxvn --delete --relative / /home /target Perhaps, a possible solution could be to temporarily disable --relative in the rsync code directly as long as it works on a / Though, I'm not absolutely sure about the side-effects of this (i.e. with include/exclude lists). I'm using Debians rsync 2.6.8-2 which should have Waynes patch included. At least Lennys test-case in the beginning of this thread is not reproducible with this version. regards Mario -- As a rule, the more bizarre a thing is, the less mysterious it proves to be. -- Sherlock Holmes by Arthur Conan Doyle -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: --delete option does not always work
On Sat, Sep 09, 2006 at 12:22:57PM -0700, Wayne Davison wrote: This is a different bug that was recently fixed: using --relative with a root (/) filesystem and --delete was also failing to delete. The latest CVS source and recent nightly tar files have this fixed. Here's the bug (which has an attached patch): https://bugzilla.samba.org/show_bug.cgi?id=3929 Oh, thank you very much. Mario -- Evidently men are more intelligent than women. Every woman on earth believes that men should be able to read minds. Every man knows this is impossible. Ergo, we are more intelligent. signature.asc Description: Digital signature -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
--delete option does not always work
I know that there are a million messages from newbies who cannot get --delete to work. This message is special. :) --delete works fine for me EXCEPT when the following two conditions are present: 1) I am using the --relative option, and 2) the deleted file is in a subdirectory of the SRC directory. Here is a demonstration of how to recreate this bug: [EMAIL PROTECTED]:/tmp$ rsync --version rsync version 2.6.4 protocol version 29 Copyright (C) 1996-2005 by Andrew Tridgell and others http://rsync.samba.org/ Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, inplace, IPv6, 64-bit system inums, 64-bit internal inums rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details. [EMAIL PROTECTED]:/tmp$ mkdir -p src/1 [EMAIL PROTECTED]:/tmp$ cd src/1 [EMAIL PROTECTED]:/tmp/src/1$ touch a b c [EMAIL PROTECTED]:/tmp/src/1$ cd /tmp [EMAIL PROTECTED]:/tmp$ /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded -v src/ dest/ building file list ... done created directory dest src/ src/1/ src/1/a src/1/b src/1/c sent 235 bytes received 98 bytes 666.00 bytes/sec total size is 0 speedup is 0.00 [EMAIL PROTECTED]:/tmp$ rm src/1/c [EMAIL PROTECTED]:/tmp$ /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded -v src/ dest/ building file list ... done src/1/ sent 99 bytes received 26 bytes 250.00 bytes/sec total size is 0 speedup is 0.00 Now at this point we would expect there to be only files 'a' and 'b' to be present in /tmp/dest/src/1. However you can see that all three files are in that directory: [EMAIL PROTECTED]:/tmp$ ls -lR dest dest: total 1 drwxr-xr-x 3 lenny lenny 1024 Apr 27 12:37 src dest/src: total 1 drwxr-xr-x 2 lenny lenny 1024 Apr 27 12:38 1 dest/src/1: total 0 -rw-r--r-- 1 lenny lenny 0 Apr 27 12:37 a -rw-r--r-- 1 lenny lenny 0 Apr 27 12:37 b -rw-r--r-- 1 lenny lenny 0 Apr 27 12:37 c Just so you know, if you attempt to do this by placing files 'a','b', and 'c' just under the 'src' directory (without the '1' subdirectory), the --delete option will work correctly. Any thoughts? Thanks, Lenny -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: --delete option does not always work
On Wed, Apr 27, 2005 at 12:57:51PM -0400, Lenny wrote: rsync -a --delete --numeric-ids --relative --delete-excluded -v src/ dest/ The problem is caused by the source dir being src/ instead of src when --relative is specified (this causes a problem internally because the starting directory is transferred as src/., so the receiver's heuristic to separate implied dirs in the file list from real dirs is not properly marking those subdirs as a part of the transferred hierarchy). You can work around the problem for now by dropping the trailing slash (while I work up a fix). Thanks for the report, ..wayne.. -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: --delete option does not always work
OK, I had a free moment to work up a fix, and here it is. It was pretty simple. ..wayne.. --- flist.c 30 Mar 2005 17:31:35 - 1.291 +++ flist.c 27 Apr 2005 19:14:17 - @@ -655,6 +655,9 @@ static struct file_struct *receive_file_ if (flags XMIT_TOP_DIR) { in_del_hier = 1; del_hier_name_len = file-dir.depth == 0 ? 0 : l1 + l2; + if (relative_paths del_hier_name_len 2 +basename_len == 1+1 *basename == '.') + del_hier_name_len -= 2; file-flags |= FLAG_TOP_DIR | FLAG_DEL_HERE; } else if (in_del_hier) { if (!relative_paths || !del_hier_name_len -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html