From owner-freebsd-questions@FreeBSD.ORG Fri Dec 1 22:38:14 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 B04F716A40F for ; Fri, 1 Dec 2006 22:38:14 +0000 (UTC) (envelope-from lorenl@alzatex.com) Received: from hosea.tallye.com (hosea.tallye.com [216.99.199.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDE4443CA3 for ; Fri, 1 Dec 2006 22:37:55 +0000 (GMT) (envelope-from lorenl@alzatex.com) Received: from hosea.tallye.com (localhost [127.0.0.1]) by hosea.tallye.com (8.13.6/8.13.6) with ESMTP id kB1McBk6011465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Dec 2006 14:38:11 -0800 Received: (from sttng359@localhost) by hosea.tallye.com (8.13.6/8.13.6/Submit) id kB1McA8F011464; Fri, 1 Dec 2006 14:38:10 -0800 Date: Fri, 1 Dec 2006 14:38:10 -0800 From: "Loren M. Lang" To: Jerry McAllister Message-ID: <20061201223810.GC24590@alzatex.com> References: <001a01c7157d$cb9feee0$d5b9bfcf@lisac> <20061201202248.GC11235@gizmo.acns.msu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+nBD6E3TurpgldQp" Content-Disposition: inline In-Reply-To: <20061201202248.GC11235@gizmo.acns.msu.edu> User-Agent: Mutt/1.4.1i X-GPG-Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc X-GPG-Fingerprint: B3B9 D669 69C9 09EC 1BCD 835A FAF3 7A46 E4A3 280C X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (hosea.tallye.com [127.0.0.1]); Fri, 01 Dec 2006 14:38:11 -0800 (PST) Received-SPF: pass (hosea.tallye.com: 127.0.0.1 is authenticated by a trusted mechanism) X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on hosea.tallye.com X-Virus-Status: Clean Cc: freebsd-questions@freebsd.org, Lisa Casey 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 22:38:14 -0000 --+nBD6E3TurpgldQp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 01, 2006 at 03:22:48PM -0500, Jerry McAllister wrote: > On Fri, Dec 01, 2006 at 02:20:42PM -0500, Lisa Casey wrote: >=20 > > Hi, > >=20 > > I want to move /var/mail to /usr/var/mail, then symlink /var/mail to=20 > > /usr/var/mail to free up space on my (too small on this machine) /var. = Of=20 > > course, I wish to maintain file permissions, ownerships, etc. I decided= to=20 > > try a dry run using a user home directory first to make sure this would= =20 > > work right. Good thing I did... > >=20 > > I created /usr/kellyw and attempted to copy the contents of /home/kel= lyw/=20 > > to it. First of all, I tried tar cvpf /usr/kellyw/kellyw.tar /home/kell= yw/ > >=20 > > When I unpack the tar file, I wind up with /usr/kellyw/home/kellyw/* N= ot=20 > > what I wanted. I wanted all of the files in /home/kellyw/ to wind up in= =20 > > /usr/kellyw/ > >=20 > > So I then tried to just copy the files using cp -p but I can't get the= =20 > > syntax right on that: > >=20 > > # 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. >=20 > You don't want to use the '*' on the receiving directory. > If there are no other subdirectories in /home/kellyw then > just do this: cp -p /home/kellyw/* /usr/kellyw/. This will miss hidden files which a home directory will surely have. Just drop the * to copy everything. >=20 > If it has subdirectories and you want it to recurse, then > do this: cp -R -p /home/kellyw/ /usr/kellyw >=20 > Unfortunately, if there are hard links in that directory, it will also=20 > make new copies of those files rather than just making new hard links. The whole point of this is because the original partition was getting too full so unless all links to the file are copied, it will have to make new copies of the files. If there are multiple hard links to the same file that need to be removed, then tar, pax, or cpio should be used. /var/mail probably won't have any nor /home/kellyw unless kellyw specifically set them up with ln. >=20 > You might want to consider using tar instead of cp if your file structure > to be moved are at all complex. >=20 > cd /home/kellyw > tar cvpf /usr/kellyw/kelly.tar * * should be . to copy everything > cd /usr/kellyw > tar xvpf kelly.tar > rm kelly.tar > cd /home/kellyw > pwd (just to be extra careful since rm -rf * is irrevocable) > rm -rf * =20 To remove everything you would have to be up one and remove the folder instead. >=20 > ////jerry >=20 > >=20 > > Can someone help me out with my syntax? The tar method would probably b= e=20 > > better (I guess) though I don't really care which method I use as long= as=20 > > it works (and preserves permissions, etc.). There are only about 60=20 > > mailboxes on this system. > >=20 > > Thanks, > >=20 > > Lisa Casey > >=20 > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd= .org" > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >=20 --=20 Loren M. Lang lorenl@alzatex.com http://www.alzatex.com/ Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2 =20 --+nBD6E3TurpgldQp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFFcK7SSHsHRHUO+igRAj3lAKCkR9ECzUCdobceWpUjDfdb/wqUiACfe2ic O5bpOn08VzE+Dbhsb84EXy4= =+YBt -----END PGP SIGNATURE----- --+nBD6E3TurpgldQp--