BackupPC-users

Re: [BackupPC-users] Different UID numbers for backuppc on 2 computers

2011-07-13 08:33:51
Subject: Re: [BackupPC-users] Different UID numbers for backuppc on 2 computers
From: Carl Wilhelm Soderstrom <chrome AT real-time DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 13 Jul 2011 07:31:41 -0500
On 07/13 03:09 , Holger Parplies wrote:
> my point was that 'find -exec chown' spawns a process for each matching file 
> it
> encounters. 

Yeah, I realize that find | xargs is more efficient. Honestly the reason I
do find -exec is because the understanding of it takes less space in my
brain. (Or, put another way, I just don't understand xargs well enough and
haven't often had need to do so). More power to you if you prefer the
efficiency of the other way; for most of the work I've done I found I don't
need the extra speed, I would rather save the thinking time. (About once
every couple of years I do need to look up how to use xargs).


> Of course, if you want to be *really* efficient, it's
> 
>       perl -MFile::Find -e '($u, $g) = (getpwnam ("backuppc")) [2, 3]; find 
> (sub { chown $u, $g, $_ if (stat) [4] == 102; }, "/");'
> 
> (one process, one chown() syscall for each inode needing to be changed, one
> recursive directory traversal), but, as you say, that's not something I'd post
> without reading manual pages and trying it out on a limited area ;-).

Cool. Thanks for posting that and the explanation (my perl-fu is pretty
nonexistent these days).

> > 'chown backuppc: <filename>' will set the group to whatever the default
> > group of the backuppc user is.
> 
> Ah, I didn't know that. Thank you for pointing that out.
> 
> > This may or may not be desireable in all cases, but it does save some
> > keystrokes when it is desired.
> 
> The main benefit I see here is that backuppc's default group may or may not be
> named 'backuppc' (probably is in most cases), so your version is simply always
> correct while mine may not be.

It is not necessarily correct; I can envision some cases where the default
group is not the one you want. (I have been bitten by this on occasion).
However, for the case we're talking about here, it's likely to be correct
99% of the time.

> > In any case, it is wise to try these sort of things out on a limited area if
> > at all possible, and read the manual page before getting too fancy.
> 
> Right. But there's no reason not to get too fancy after having done that ;-).

Just so long as it remains understandable to the next admin who comes along.
:)

Keep up the good work!

-- 
Carl Soderstrom
Systems Administrator
Real-Time Enterprises
www.real-time.com

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/