From owner-freebsd-questions Tue Oct 1 11: 7:29 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3D5237B401 for ; Tue, 1 Oct 2002 11:07:27 -0700 (PDT) Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8594B43E6A for ; Tue, 1 Oct 2002 11:07:27 -0700 (PDT) (envelope-from Hostmaster@Video2Video.Com) Received: from earl-grey.cloud9.net (earl-grey.cloud9.net [168.100.1.1]) by russian-caravan.cloud9.net (Postfix) with ESMTP id F0679291B0 for ; Tue, 1 Oct 2002 14:04:23 -0400 (EDT) Date: Tue, 1 Oct 2002 14:04:23 -0400 (EDT) From: Peter Leftwich X-X-Sender: To: FreeBSD LIST Subject: Re: Copying directories contents In-Reply-To: <20021001175837.GF7147@dan.emsphone.com> Message-ID: <20021001140103.G2271-100000@earl-grey.cloud9.net> Organization: Video2Video Services - http://Www.Video2Video.Com MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 1 Oct 2002, Dan Nelson wrote: > In the last episode (Oct 01), Beech Rintoul said: > > I'm need to take the contents including dotfiles from about 300 user > > directories and move them into another set of identical directories on > > another filesystem. Is there an easy script to do this? I dont want to > > overwrite the contents of the target directories just add to them. > > Both filesystems are mounted on the source machine. > tar cf - user1 user2 user3 user4 | ( cd /destination ; tar xpf - ) I really must learn how to use conditional stuff in Unix, such as && and parentheses :) > Change "tar xpf" to "tar xpkf" if you don't want to overwrite exisitng > files in the destination directory. > > "cp -r" might work also; I have never tried it when the destination was > aready populated with files, though. > Dan Nelson > dnelson@allantgroup.com I have often run into a similar situation. There doesn't seem to be a command line or GUI file explorer you can use to "stitch together" source directories and subdirectories into the target directory. For example, if you have differing files but in the same exact folder tree structure, is there a command to weave (mv) the files in? This would be a scheme that favors only files and that runs a "test" of basically saying "is the directory there already? yes, then mv this file into it, no, then create it and move this file into it..." but on a wider scale. -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message