[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Recovering from "chown -R" disaster



Steve Grubb wrote:
On Thursday 13 September 2007 17:34:09 Michael Weber wrote:
Any help out there?

Seems like you could script something to use rpm's database to restore perms. "rpm -qa" would populate a list of all packages.

rpm -ql --verbose $package | awk '{ printf "%s,%s %s\n", $3, $4, $9 }'

would get you the owner, group and file. This would fix most files, but something like user's home dirs or directories with sticky bits need identifying and fixing.

For completeless, it's possible to use something like
rpm -qa --qf 'chown %{name} <some other stuff>'
to produce a formatted list of anything at all including the individual files in the rpm database.

It will take more trouble than I'll do for free to get it to do what you want, but it's possible and it's sort-of documented in the rpm documentation, and for sure I'd do it if I needed to.

But, the setperms etc look the way to go in this instance.

--

Cheers
John

-- spambait
1aaaaaaa coco merseine nu  Z1aaaaaaa coco merseine nu

Please do not reply off-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]