From owner-freebsd-questions Thu Jul 23 16:04:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA21871 for freebsd-questions-outgoing; Thu, 23 Jul 1998 16:04:53 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from pau-amma.whistle.com (s205m64.whistle.com [207.76.205.64]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA21857 for ; Thu, 23 Jul 1998 16:04:48 -0700 (PDT) (envelope-from dhw@whistle.com) Received: (from dhw@localhost) by pau-amma.whistle.com (8.8.8/8.8.7) id QAA07883; Thu, 23 Jul 1998 16:03:25 -0700 (PDT) (envelope-from dhw) Date: Thu, 23 Jul 1998 16:03:25 -0700 (PDT) From: David Wolfskill Message-Id: <199807232303.QAA07883@pau-amma.whistle.com> To: beaupran@JSP.UMontreal.CA Subject: Re: Misc (was: Re: Creating the filesystem ) Cc: freebsd-questions@FreeBSD.ORG In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >Date: Thu, 23 Jul 1998 18:06:00 -0400 (EDT) >From: Spidey >I'm now backing up /usr. By curiosity, when I tried to backup my /usr >using only tar cvf /mnt/usr.tar /usr/. , my df's were showing me the >progression... At one point the filesystem got full, but the tarring kept >on going until it was -32Mb of storage left!!! I guess that was my swap >space that was being swallowed. Is it right? Also, why did it stopped at >32Mb, and not at 70Mb, the size of my swap? No; different issue. "df" shows the amount of space that a "normal" (non-root) user is allowed to write toe the filesystem. There is (in the Berkeley FFS, or "ufs") a percentage of space reserved, that only root is allowed to write to (because to the extent that space gets used, performance gets trashed -- not unlike an Ethernet where collisions get excessively high). If more space is used than a "normal" user is allowed to allocate, the "available" column shows a negative number. >I was wondering if there was an easy way to make a "monitor" that would >do: >while true > clear > df >I tried, but never got a correct syntax. Well, this is dependent on which shell you're using. For csh & tcsh, for example, this works: while (1) clear && df && sleep 5 end [You'll note that I put a "sleep 5" in there; this provides an opportunity to read the display before it changes.] For Bourne shell (sh), the following works: while true do clear && df && sleep 5 done I don't recommend csh for scripts, generally. Of course, you could also use Perl, but that would be a fairly clear case of "overkill." >Is there good resource (on the >net if possible) for shell-script programming? I expect so; I don't recall one, but an AltaVista search is likely to turn up several pages -- probably of varying quality. :-} Cheers, david -- David Wolfskill UNIX System Administrator dhw@whistle.com voice: (650) 577-7158 pager: (650) 371-4621 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message