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

Re: Simple way to save login/password info

David wrote regarding 'Re: Simple way to save login/password info' on Fri, May 11 at 11:09:
> > > Well, you could
> > >   scp /etc/passwd /etc/shadow backupmachine:/backupdir/
> Probably best to use rsync here; faster, compresses the stream, doesn't 
> just blindly overwrite the remote end, etc.

The CPU utilization required to calculate checksums and do the
compression is comparable to or greater than that involved in simply
sending those two (or four) fairly small file over the network, and in
both cases is dwarfed by the key negotiation time that ssh2 will use by
default.  Here's a very scientific test using precise testing tools ;)

sauer@midnight:~$ time rsync -e ssh -z /etc/passwd /etc/passwd
/etc/group /etc/group zipper:/tmp

real    0m0.763s
user    0m0.020s
sys     0m0.032s
sauer@midnight:~$ time scp -q /etc/passwd /etc/passwd /etc/group
/etc/group zipper:/tmp

real    0m0.373s
user    0m0.024s
sys     0m0.008s

Note that rsync actually optimizes and only sends each file once, while
scp sent both files twice (I didn't feel like setting up keys for root,
which is why I didn't include shadow/gshadow).

I actually ran a plain scp first to get the files cached and have them
in place on the remote end.  Sometimes compression actually hurts
performance (particularly if one of the machines isn't a real speedy
system)...  Also, rsync *will* blindly overwrite the files on the other
side if they're named the same, unless you explicitly tell it not to do
so.  It'll just do so with fewer bits transferred than scp would.  :)

That said, I totally agree that all of /etc is nice to have under CVS /
RCS / SVN control, and that it'd be handy to back those up instead.  I'd
definitely use rsync then... ;)

--Danny, who still thinks that importing to LDAP would be better still :)

To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.