From owner-freebsd-questions@FreeBSD.ORG Mon Dec 28 10:05:00 2009 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 30205106566B for ; Mon, 28 Dec 2009 10:05:00 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2A48FC18 for ; Mon, 28 Dec 2009 10:04:59 +0000 (UTC) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id nBSA4rX6095890; Mon, 28 Dec 2009 10:04:54 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk nBSA4rX6095890 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1261994694; bh=tvQP11PVfycudNWC6KzVEh4Uj3LZIW4FLg/2KZbaiZU=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4B3882BF.7060104@infracaninophile.co.uk>|Date:=20M on,=2028=20Dec=202009=2010:04:47=20+0000|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.23=20(X11/20091129)|MIME-Vers ion:=201.0|To:=20=3D?windows-1251?Q?=3DCA=3DEE=3DED=3DFC=3DEA=3DEE =3DE2_=3DC5=3DE2=3DE3=3DE5=3DED=3DE8=3DE9?=3D=0D=0A=20|CC:=20freebsd-questions@freebsd.org|Subject:=20Re:=20How=2 0to=20force=20tar=20to=20be=20quiet?|References:=20<1846015154.200 91227185106@yandex.ru>=20<4B37AB6D.3020507@infracaninophile.co.uk> =20<1047257846.20091227221031@yandex.ru>|In-Reply-To:=20<104725784 6.20091227221031@yandex.ru>|X-Enigmail-Version:=200.95.6|Content-T ype:=20multipart/signed=3B=20micalg=3Dpgp-sha256=3B=0D=0A=20protoc ol=3D"application/pgp-signature"=3B=0D=0A=20boundary=3D"---------- --enigF8B0696EB6432F384063A3AE"; b=Kul/YU44SpnBJbk84xKGZeF9umnvAIbxJBEfDIGmQ2wWoGmk+8h9TbUCnZXhBuIVR c35HjLGBJ7Ri2ls6sdS/SprXdxHg4w5oB8HXGzER6vziQzkKJMe6gTlwRU+MUr7EAb WBff1eQ6R21GqQwYXFLdviII8rQUuXdeMBrgy/qw= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4B3882BF.7060104@infracaninophile.co.uk> Date: Mon, 28 Dec 2009 10:04:47 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.23 (X11/20091129) MIME-Version: 1.0 To: =?windows-1251?Q?=CA=EE=ED=FC=EA=EE=E2_=C5=E2=E3=E5=ED=E8=E9?= References: <1846015154.20091227185106@yandex.ru> <4B37AB6D.3020507@infracaninophile.co.uk> <1047257846.20091227221031@yandex.ru> In-Reply-To: <1047257846.20091227221031@yandex.ru> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF8B0696EB6432F384063A3AE" X-Virus-Scanned: clamav-milter 0.95.3 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: How to force tar to be quiet? 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: Mon, 28 Dec 2009 10:05:00 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF8B0696EB6432F384063A3AE Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: quoted-printable =CA=EE=ED=FC=EA=EE=E2 =C5=E2=E3=E5=ED=E8=E9 wrote: > =C7=E4=F0=E0=E2=F1=F2=E2=F3=E9=F2=E5, Matthew. >=20 > =C2=FB =EF=E8=F1=E0=EB=E8 27 =E4=E5=EA=E0=E1=F0=FF 2009 =E3., 20:46:05:= >=20 > MS> =CA=EE=ED=FC=EA=EE=E2 =C5=E2=E3=E5=ED=E8=E9 wrote: >>> =C7=E4=F0=E0=E2=F1=F2=E2=F3=E9=F2=E5, Freebsd-questions. >>> >>> when >>> tar -cf file.tar /home/* >>> It always says: >>> tar: Removing leading '/' from member names >>> >>> man tar >>> -P Preserve pathnames... >>> But I do not need to preserve. I want to tar without that warning. >>> >>> How to force tar to be quiet? >>> >=20 > MS> Don't give the leading '/' in path names. Like so: >=20 > MS> tar -cf file.tar -C / home >=20 > MS> Cheers, >=20 > MS> Matthew =20 >=20 > # tar -cf /home/kes/backup/conf/aaa_etc.tar -C / boot/loader.conf etc/*= usr/local/etc/* usr/local/virtwww/* > tar: No match. Yep. As shown, you don't need '*' here. tar(1) is perfectly capable of = recursing through a directory hierarchy given only the name of the top level direct= ory. [ * is actually expanded by your shell, rather than tar, so it's trying t= o match filenames against your current working directory, and not against the dir= ectory the '-C' switches tar to.]=20 > And next does not work as expected: > # tar -cf /home/kes/backup/conf/aaa_etc.tar -C / boot/loader.conf etc u= sr/local/etc usr/local/virtwww >=20 > I get: > boot > etc > mysite > local > sub > usr > virtwww Hmmm... I can't reproduce this locally. If I run: sudo tar -cf foo.tar -C / etc boot then I get (as expected) a tarball with the contents of /etc and /boot --= not only that, but there's nothing printed to stdout/stderr while the command= runs. Are any of the directories concerned symbolic links on your system? tar(= 1) handles sym-links quite carefully given that it's possible to use them to= generate specially crafted tar archives that you can use to trick an unwa= ry admin into overwriting security sensitive files. As a rule of thumb, whe= n specifying directory trees to back-up, try and avoid having any path comp= onents being symbolic links. > Why local, sub, mysite, virtwww are in ROOT or tar??? > 'local' must be under 'usr' > 'virtwww' must be under 'local' > 'mysite' must be under 'virtwww' > but not in root >=20 > Why I get that wrong result? You'ld need to tell us a lot more detail about your system before anyone = can answer that. We can guess -- the sym-link problems I talk about above ar= e my attempt -- and I can tell you that the command as stated works for me, wh= ere everything is installed in a single UFS2 filesystem and it's all arranged= in the natural directory tree without trying to rearrange chunks of filesystems = using sym-links. If you're doing anything different to that, then please say s= o. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enigF8B0696EB6432F384063A3AE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAks4gsUACgkQ8Mjk52CukIzIiACglT4gJT1KMMfAbpuExLnJvSKf H9IAn2nj16lVumwX9QMTW43B7vljUQO4 =jDhx -----END PGP SIGNATURE----- --------------enigF8B0696EB6432F384063A3AE--