RsyncProject / rsync

An open source utility that provides fast incremental file transfer. It also has useful features for backup and restore operations among many other use cases.
https://rsync.samba.org
Other
2.88k stars 337 forks source link

--fake-super ignores links #150

Closed Nesaijn closed 3 years ago

Nesaijn commented 3 years ago

When using rsync with --fake-super and --links while having symbolic links, it does not copy them. They only appear as files with the link as content.

$ rsync --version
rsync  version v3.2.3  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes,
    batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv,
    symtimes, prealloc, stop-at, no crtimes
Optimizations:
    SIMD, asm, openssl-crypto
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none

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.
$ ls -lR
.:
total 8
drwxr-xr-x 2 nesaijn nesaijn 4096 10. Feb 12:04 dest
drwxr-xr-x 2 nesaijn nesaijn 4096 10. Feb 12:02 src

./dest:
total 0

./src:
total 0
-rw-r--r-- 1 nesaijn nesaijn 0 10. Feb 12:01 file1
lrwxrwxrwx 1 nesaijn nesaijn 9 10. Feb 12:02 file2 -> src/file1
$ rsync -r --links --fake-super src/ dest
$ ls -lR
.:
total 8
drwxr-xr-x 2 nesaijn nesaijn 4096 10. Feb 12:06 dest
drwxr-xr-x 2 nesaijn nesaijn 4096 10. Feb 12:02 src

./dest:
total 4
-rw-r--r-- 1 nesaijn nesaijn 0 10. Feb 12:06 file1
-rwxr-xr-x 1 nesaijn nesaijn 9 10. Feb 12:06 file2

./src:
total 0
-rw-r--r-- 1 nesaijn nesaijn 0 10. Feb 12:01 file1
lrwxrwxrwx 1 nesaijn nesaijn 9 10. Feb 12:02 file2 -> src/file1
WayneD commented 3 years ago

Yup, that's how it works. It's avoiding creating dangerous links while keeping the info intact.