rsync and broken symlinks

Yakov Hrebtov jake at generation.ru
Thu Dec 16 09:34:02 GMT 2004


Hello, Wayne.

WD> I can only imagine that this is some kind of OS misfeature.  Try running
WD> rsync under something like "strace -f" (or your OS's equivalent) and see
WD> what is going wrong with the system calls.  If you see readlink() return
WD> -1 for the file, that would cause rsync to skip it as non-existent.

25737 lstat64("file", {st_mode=S_IFREG|0644, st_size=4, ...}) = 0
25737 access("file", R_OK)              = 0
25737 lstat64("good-link", {st_mode=S_IFLNK|0777, st_size=4, ...}) = 0
25737 readlink("good-link", "file", 4095) = 4
25737 access("good-link", R_OK)         = 0
25737 lstat64("broken-link", {st_mode=S_IFLNK|0777, st_size=22, ...}) = 0
25737 readlink("broken-link", "file-that-doesnt-exist", 4095) = 22
25737 access("broken-link", R_OK)       = -1 ENOENT (No such file or directory)

You see, readlink call is successful. But rsync then trying to access
the referent of symlink... But referent doesnt exist.

my system is GNU/Linux running kernel 2.4.25
Can you give me any advices?

Thank you
-- 
WBR, Yakov                          mailto:jake at generation.ru



More information about the rsync mailing list