chattr

Marc Evans Marc at SoftwareHackery.Com
Tue Jan 28 12:32:47 EST 2003


On Tue, 28 Jan 2003, Steven W. Orr wrote:

> On Tue, 28 Jan 2003, Marc Evans wrote:
>
> =>Hello -
> =>
> =>I am trying to find a program, ideally rsync, that preserves attributes
> =>set by chattr, when a file is copied. For example, consider the following:
> =>
> =>	cd /var/tmp
> =>	touch foo
> =>	chattr +i foo
> =>	rsync foo bar
> =>	lsattr foo bar
> =>
> =>I have experimented with several different programs, but have not found
> =>anything that seems to archive those file attributes. Have any of you
> =>encountered this and if so, how do you address it?
> =>
> =>Thanks - Marc
> You're going to have to write it yourself. Doesn't look too hard. Here's a
> scheme. Have your backup create a file called fn.chattr by running lsattr
> for every file you copy. Then process the .chattr file by running a set of
> chattr commands. Clean up by removing the .chattr files.

So, when performing a backup of a filesystem (ext2 or ext3) which has
these attributes, it seems that none of the tools that I have been able to
identify actually backup file attributes. As a result, if you ever set
those attributes, you need to keep a log of how so that should you ever
need to restore from a backup, you know how to reset the attributes. I
hope that I am wrong on this, as it would be truely sad if this is true.

- Marc




More information about the gnhlug-discuss mailing list