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

Re: [users] NO! chmod strikes!



On Tue, Jul 10, 2001 at 01:12:37AM +0200, Joost Kooij wrote:
> On Mon, Jul 09, 2001 at 06:36:08PM +0200, Martin F. Krafft wrote:
> > but anyway, a question for all debianers: how do you get the default
> > permissions back on the / tree?
> 
> If you have a clean host with very similar filesystem contents, try this:
>        
>   ssh root@okayhost "find / -regex '/\(mnt\|proc\|tmp\)/.*' -prune -or \
>       -not -type l -not -type s -printf '%04.4m %u %g %p\n' " \
>     | while read mode user group path
>     do 
>       chown $user.$group $path 
>       chmod $mode $path 
>     done 

DANG. nice implementation there!

> Alternatively, create a huge script like this:
> 
>   find / -regex '/\(mnt\|proc\|tmp\)/.*' -prune -or \
>     -not -type l -not -type s -printf 'chown %u.%g %p\nchmod %m %p\n' \
>     > fixperms.sh
> 
> And copy that to the broken machine and run "sh fixperms".
> 
> It might not fix all files, unless the two hosts are nearly equal, but
> enough to let you find the missing ones to fix by hand.  Maybe /home/*
> will need special care.

not too shabby here, either. but i really like that first one.

how about coming up with some more clever script examples?
a thousand debianistas are waiting to adore (and newbies are
waiting to learn)...

	newbieDoc.sourceForge.net could use your brain...

c'mon, just a few more shell scripts. awesome!

-- 
DEBIAN NEWBIE TIP #48 from Will Trillich <will@serensoft.com> 
:
To peruse your CURRENT VIM SETTINGS (there's LOTS of them)
from within Vim, simply do
	:options
You can change them there, on-the-fly, as well. Type
"ctrl-W ctrl-W" to switch "panes" or "ctrl-W q" to close one.
Try ":help" to learn more.

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: