Pawel
2006-Apr-25 14:27 UTC
deletion those files from destination directory, that no longer exist in source directory.
Hallo I thought that I need to use `--delete' option for that, but it looks like not. Problem explanation: prompt# ls /tmp/dir1/ /tmp/dir2/ /tmp/dir1/: fil1.txt /tmp/dir2/: fil1.txt fil2.txt prompt# rsync --delete /tmp/dir1/* /tmp/dir2/ prompt# ls /tmp/dir1/ /tmp/dir2/ /tmp/dir1/: fil1.txt /tmp/dir2/: fil1.txt fil2.txt # fil2.txt still exists My question is, whether is it a bug or I am mistaken ? Greetings ps. prompt# rsync -v rsync version 2.6.7 protocol version 29 Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.
Wayne Davison
2006-Apr-25 16:21 UTC
deletion those files from destination directory, that no longer exist in source directory.
On Tue, Apr 25, 2006 at 04:20:48PM +0200, Pawel wrote:> prompt# rsync --delete /tmp/dir1/* /tmp/dir2/This is mentioned specifically in the man page: --delete This tells rsync to delete extraneous files from the receiving side (ones that aren't on the sending side), but only for the directories that are being synchronized. You must have asked rsync to send the whole directory (e.g. "dir" or "dir/") without using a wildcard for the directory's contents (e.g. "dir/*") since the wildcard is expanded by the shell and rsync thus gets a request to transfer individual files, not the files' parent directory. Files that are excluded from transfer are also excluded from being deleted unless you use the --delete-excluded option or mark the rules as only matching on the sending side (see the include/exclude modifiers in the FILTER RULES section). ..wayne..
Possibly Parallel Threads
- [Bug 13587] New: Add a --dry-run way to show destination for each item
- rsync-ing from two locations with same filenames (at different versions)
- Odd behavior with --detect-renamed
- directories not correctly recognized rsync-3.0.4
- Difference in behaviour with --backup