Re: symlink bug still not fixed
On Thu, Apr 22, 2004 at 08:01:29PM -0700, Peter Sturdza wrote: I found and reported a bug about a year ago regarding symbolic links but haven't seen any mention of it since and it is still present in 2.6.1-pre2. Just want to make sure it isn't forgotten. Thanks for the reminder. I hope to get some bug-reporting software going before too long, but in the meantime, it is helpful when people mention bugs that have fallen through the cracks. With the archive, update and backup options set, rsync will always replace the file with the symlink even when the file is newer The way rsync currently works, it doesn't consider a file and a symlink to be the same thing, so the -u option will not prevent a file from being replaced by a symlink. You can use the -L option to avoid this, but that will cause all symlinks to be expanded into separate files. (and it will not save a backup either). This is a bug. There are a few places in the code that remove files when the type of the file changes, and not all of them make a proper backup of the replaced object. I'll look into fixing this for the next release (the one after 2.6.1). Thanks for providing a simple test case -- that's always very useful. ..wayne.. -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: symlink bug still not fixed
--- Wayne Davison [EMAIL PROTECTED] wrote: ... The way rsync currently works, it doesn't consider a file and a symlink to be the same thing, so the -u option will not prevent a file from being replaced by a symlink. ... Hmm. But the symlink is older. I would expect the symlink to overwrite an older file, but not a newer one, which it does. Well, maybe it is philosophical, but I see this as a problem. Firstly, and most obviously, the unexpected loss of a symlink is not as tragic as the loss of a file with potentially lots of data in it. In fact, the symlink will replace a directory too, so you could lose an entire directory tree! At least a note to this effect should show up in a README or man page, no? Secondly, symlinks are often used to avoid duplicate identical files. It isn't unreasonable to then assume that if one of them needs a slight modification, one would replace the symlink with a regular file and make that modification. Now, if you use rsync to synchronize your desktop and laptop, say, then the modification is destroyed. I therefore believe that this behavior is counter-intuitive and strongly suggest that it be changed so that a symlink doesn't replace anything else with a newer date stamp when the -u option is used. After all, -u stands for update! Peter __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: symlink bug still not fixed
On Thu, Apr 22, 2004 at 08:54:57PM -0700, Peter Sturdza wrote: Hmm. But the symlink is older. I would expect the symlink to overwrite an older file, but not a newer one, which it does. If it was an older directory, would you expect it to also not replace a newer file? Rsync doesn't work that way, though I can see how someone might want it to. I will consider such a change for the future, but I'll have to spend time contemplating the repercussions. Anyone else want to weigh-in on how they expect -u to work? It isn't unreasonable to then assume that if one of them needs a slight modification, one would replace the symlink with a regular file and make that modification. Now, if you use rsync to synchronize your desktop and laptop, say, then the modification is destroyed. You might want to check into unison. It is designed to handle a situation where changes are being made on both ends of the transfer. ..wayne.. -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: symlink bug still not fixed
--- Wayne Davison [EMAIL PROTECTED] wrote: I will consider such a change for the future, but I'll have to spend time contemplating the repercussions. Thanks. If you decide against changing the behavior, then please add a note in the man page (perhaps where the -u option is explained and in the section devoted to symlinks) just to clearly document what rsync does. And thanks for the tip about unison; I had not heart of it before. Peter __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html