From owner-freebsd-questions@FreeBSD.ORG Fri Aug 27 18:43:12 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 652A5106566B for ; Fri, 27 Aug 2010 18:43:12 +0000 (UTC) (envelope-from bill@celestial.com) Received: from dorsai-02.celestial.com (dorsai-02.celestial.com [192.136.111.19]) by mx1.freebsd.org (Postfix) with ESMTP id 8CCCD8FC15 for ; Fri, 27 Aug 2010 18:43:11 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by dorsai-02.celestial.com (Postfix) with ESMTP id D8CF52074D1A for ; Fri, 27 Aug 2010 11:43:09 -0700 (PDT) X-Virus-Scanned: amavisd-new at celestial.com Received: from dorsai-02.celestial.com ([127.0.0.1]) by localhost (dorsai-02.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jUb6qYwDUvEz for ; Fri, 27 Aug 2010 11:43:09 -0700 (PDT) Received: from ayn.mi.celestial.com (hayek.celestial.com [192.136.111.12]) by dorsai-02.celestial.com (Postfix) with ESMTP id 979082074D11 for ; Fri, 27 Aug 2010 11:43:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ayn.mi.celestial.com (Postfix) with ESMTP id 6FB9A68947902; Fri, 27 Aug 2010 11:43:09 -0700 (PDT) X-Virus-Scanned: amavisd-new at mi.celestial.com Received: from ayn.mi.celestial.com ([127.0.0.1]) by localhost (ayn.mi.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OGD4SlYBv5Ov; Fri, 27 Aug 2010 11:43:09 -0700 (PDT) Received: by ayn.mi.celestial.com (Postfix, from userid 203) id 4F266689478F1; Fri, 27 Aug 2010 11:43:09 -0700 (PDT) Date: Fri, 27 Aug 2010 11:43:09 -0700 From: Bill Campbell To: freebsd-questions@freebsd.org Message-ID: <20100827184309.GA1390@ayn.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <20100827170737.GA96063@thought.org> <20100827172914.GE22105@ayn.mi.celestial.com> <20100827174607.GA96341@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100827174607.GA96341@thought.org> User-Agent: Mutt/1.5.19 OpenPKG/% (2009-01-05) Subject: Re: how do i scp .dotfiles?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:43:12 -0000 On Fri, Aug 27, 2010, Gary Kline wrote: >On Fri, Aug 27, 2010 at 10:29:14AM -0700, Bill Campbell wrote: >> On Fri, Aug 27, 2010, Gary Kline wrote: >> > >> >guys, >> > >> >this is the start of my master switchover. how to i copy/scp,say, >> >~/.purpur to home/kline/.purple? along with many hundreds of other >> >dot files? scp doesn't do it. >> > >> scp -r to recursively copy directories? That should get >> everything in each directory. >> >> We tend to use rsync for this, making an initial copy to get the >> majority of the files transferred before making the final cut >> over, the ``rsync --delete ...'' to bring things up to date >> before making the final switch. When switching to a new mail >> server we have done this live with about 10,000 users, but when >> we did this, we left the Maildir stores empty before the final >> rsync and didn't use --delete on the Maildir directories. This >> allowed new mail to be processed as it came in, and the older >> mail wouldn't conflict as the Maildir message file names should >> be unique. >> > > So what would the rsync line be starting from ~kline and pointing > at ethiv? ethic is my temporary savings machine while i install > the "newtao", m y new desktop. Assuming that ~kline is /home/kline and will go to /home/kline on the remote machine this would work (decoding the options is left as an exersize for the student :-). cd /home rsync -vaHrP kline othermachine:/home A more general solution that doesn't require ssh, but connects to the rsync daemon on the remote machine might be to create a module definition in the destination machine's /etc/rsyncd.conf file something like this: [myhome] uid = myusername gid = mygroupname read only = false use chroot = true path = /path/to/myhomedirectory comment = /path/to/myhomedirectory hosts allow = sourceipaddress hosts deny = * Then the rsync command could be: rsync -vaHrP ~/kline/ othermachine::myhome/ This has a couple of advantages. First the destination uid:gid can be different on the destination machine as rsync uses the names in the group and passwd database. Assuming you're on a LAN where ssh security isn't critical using the daemon/module approach doesn't require ssh authorized_keys, and can be restricted to one or more IP addresses or CIDR blocks. We use this when moving between systems where the uid:gid mapping is different when moving between machines of differing OS releases (e.g. SuSE Linux to FreeBSD), or where the destination machine may have existing users with conflicting uid:gid s Bill -- INTERNET: bill@celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792 ... because most politicians and bureaucrats are technological idiots, it's going to be crucial for the rank and file members of the IT community to find its collective voice soon. --Michael Vizard, InfoWorld Editor in Chief.