top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How To preserve file attributes (chattr/lsattr) when copy it to another location

+2 votes
317 views

I must copy a dir with some file with 'i' attribute set, but rsync (or cp) do not copy this attribute.

See this little example:

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

There is a way to copy all attribute?

posted May 12, 2015 by Majula Joshi

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

When I was running mate on another computer, I would log off or shutdown, and power up and login again and mate would restore all the gui apps in all the workspaces.

Gnome does not do that.

Also, I do not have a way to upgrade to Centos 7 because
1. graphic installation fails (as I have posted here before).
2. I do not want to do text install because it will clobber my existing partitioning scheme and does not provide for modifying the automatic partitioning scheme.

–1 vote

I have a large file which has "some string"so many times, i want it to be replaced with "other string" at all places, using vi or vim editor?
Is there any way to do that?

...