4

I just stumbled upon the fact that rsync doesn't preserve at least the ext3 "immutable" flag - while it should do so when using -a, IMHO. Quick test case:

# touch testfile
# chattr +i testfile
# rsync -a testfile testfile2
# lsattr testfile*
----i---------- testfile
--------------- testfile2

The man page of rsync tells about the -a switch:

The files are transferred in "archive" mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer.

Can somebody please shed some light on this: What's meant by "attributes" here if not the attributes of the underlying filesystem? If it really means something other: Is there a possibility to sync ext3 attributes as well?

Jonas
  • 243
  • 1
  • 5
  • 1
    For clarification: This has nothing to do with _extended_ attributes which could be synced with `-X`. The immutable flag is an attribute, not an extended attribute. – Jonas Feb 02 '11 at 10:28

1 Answers1

1

Not going to happen with rsync.

Rsync does it's best to backup any filesystem type and make it look the same on another filesystem type. so chattr +i is pretty ext* specific so rsync ignores those.

Rsync is more worried about permissions and ownership of the file.

You'd have to create some wrapper script around rsync to do that job

Mike
  • 21,910
  • 7
  • 55
  • 79