From owner-freebsd-questions@FreeBSD.ORG Fri Dec 1 21:51:24 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5F5516A505 for ; Fri, 1 Dec 2006 21:51:24 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from overlord.navalradio.cl (overlord.navalradio.cl [201.236.67.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84EB643CA6 for ; Fri, 1 Dec 2006 21:51:07 +0000 (GMT) (envelope-from mikhailg@webanoide.org) Received: from [192.168.10.3] (shanshito.webanoide.org [150.101.108.110]) (authenticated bits=0) by overlord.navalradio.cl (8.13.6/8.13.6) with ESMTP id kB1Lq925037652; Fri, 1 Dec 2006 18:52:15 -0300 (CLST) (envelope-from mikhailg@webanoide.org) Message-ID: <4570A3CB.6010004@webanoide.org> Date: Sat, 02 Dec 2006 08:51:07 +1100 From: Mikhail Goriachev Organization: Webanoide User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Lisa Casey References: <001a01c7157d$cb9feee0$d5b9bfcf@lisac> In-Reply-To: <001a01c7157d$cb9feee0$d5b9bfcf@lisac> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.56 on 201.236.67.146 X-Spam-Status: No, score=-100.0 required=5.0 tests=USER_IN_WHITELIST autolearn=failed version=3.1.4 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on overlord.navalradio.cl Cc: freebsd-questions@freebsd.org Subject: Re: Moving /var/mail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2006 21:51:24 -0000 Lisa Casey wrote: > Hi, > > I want to move /var/mail to /usr/var/mail, then symlink /var/mail to > /usr/var/mail to free up space on my (too small on this machine) /var. Of > course, I wish to maintain file permissions, ownerships, etc. I decided to > try a dry run using a user home directory first to make sure this would work > right. Good thing I did... > > I created /usr/kellyw and attempted to copy the contents of /home/kellyw/ > to it. First of all, I tried tar cvpf /usr/kellyw/kellyw.tar /home/kellyw/ > > When I unpack the tar file, I wind up with /usr/kellyw/home/kellyw/* Not > what I wanted. I wanted all of the files in /home/kellyw/ to wind up in > /usr/kellyw/ > > So I then tried to just copy the files using cp -p but I can't get the > syntax right on that: > > # cd /home/kellyw > # ls -l > total 16 > -rw-r--r-- 1 kellyw kellyw 767 Aug 18 14:52 .cshrc > -rw-r--r-- 1 kellyw kellyw 248 Aug 18 14:52 .login > -rw-r--r-- 1 kellyw kellyw 158 Aug 18 14:52 .login_conf > -rw------- 1 kellyw kellyw 373 Aug 18 14:52 .mail_aliases > -rw-r--r-- 1 kellyw kellyw 331 Aug 18 14:52 .mailrc > -rw-r--r-- 1 kellyw kellyw 797 Aug 18 14:52 .profile > -rw------- 1 kellyw kellyw 276 Aug 18 14:52 .rhosts > -rw-r--r-- 1 kellyw kellyw 975 Aug 18 14:52 .shrc > # cp -p /home/kellyw/* /usr/kellyw/* > cp: No match. > # cp -p /home/kellyw/ /usr/kellyw/ > cp: /home/kellyw/ is a directory (not copied). > # cp -p /home/kellyw/*.* /usr/kellyw/*.* > cp: No match. > > Can someone help me out with my syntax? The tar method would probably be > better (I guess) though I don't really care which method I use as long as > it works (and preserves permissions, etc.). There are only about 60 > mailboxes on this system. You could do something like this[1]: # tar -cvf - -C /home/kellyw . | tar -xpBf - -C /usr/kellyw Regards, Mikhail. [1] - Taken from 'man tar', EXAMPLES section. -- Mikhail Goriachev Webanoide Telephone: +61 (0)3 62252501 Mobile Phone: +61 (0)4 38255158 E-Mail: mikhailg@webanoide.org Web: http://www.webanoide.org PGP Key ID: 0x4E148A3B PGP Key Fingerprint: D96B 7C14 79A5 8824 B99D 9562 F50E 2F5D 4E14 8A3B