From owner-freebsd-questions@FreeBSD.ORG Wed Sep 5 11:25:35 2007 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 0245316A418 for ; Wed, 5 Sep 2007 11:25:35 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (66-230-99-27-cdsl-rb1.nwc.acsalaska.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id C441A13C4A5 for ; Wed, 5 Sep 2007 11:25:34 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id 38EDD1CCA6 for ; Wed, 5 Sep 2007 03:25:03 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Wed, 5 Sep 2007 13:25:01 +0200 User-Agent: KMail/1.9.7 References: <6f4f57f60709050415w585b9452t1738d979dcfeaf66@mail.gmail.com> In-Reply-To: <6f4f57f60709050415w585b9452t1738d979dcfeaf66@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709051325.02036.fbsd.questions@rachie.is-a-geek.net> Subject: Re: umount in shell script 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: Wed, 05 Sep 2007 11:25:35 -0000 On Wednesday 05 September 2007 13:15:34 George Vanev wrote: > Hi all, > I have the following script: > > > #!/bin/sh > mnt_path='//user@server1/archive' > mnt_ip='xxx.xxx.xxx.xxx' > > mkdir /usr/tmp_mnt > mount_smbfs -N -I $mnt_ip $mnt_path /usr/tmp_mnt > > #rotate files > #dump mysql database > #gzip > #encrypt > #copy to /usr/tmp_mnt > > umount /usr/tmp_mnt > > > Sometimes /usr/tmp_mnt is still mounted. > It's random behavior. > I didn't noticed any logic when it is unmounted or not. Unmounts don't work when device is busy, ie: someone using a file or with cwd within the filesystem. umount -f will take care of it, or use fstat -f /usr/tmp_mnt to check before unmounting. -- Mel People using reply to all on lists, must think I need 2 copies.