From owner-freebsd-questions@FreeBSD.ORG Tue Sep 4 03:30:48 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 36E6D16A41A for ; Tue, 4 Sep 2007 03:30:48 +0000 (UTC) (envelope-from xrayv19@yahoo.com) Received: from web58102.mail.re3.yahoo.com (web58102.mail.re3.yahoo.com [68.142.236.125]) by mx1.freebsd.org (Postfix) with SMTP id CBEED13C469 for ; Tue, 4 Sep 2007 03:30:47 +0000 (UTC) (envelope-from xrayv19@yahoo.com) Received: (qmail 92753 invoked by uid 60001); 4 Sep 2007 03:30:46 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=U1/fFJFV1nPCXfHVCXTDMfM9bYOBItUbz7We0+1Wg0F42R4P6HA1MbHCpsYAmNTCx+9fiwvFG5uDjdFwFXusBKnokv9OR7rvG9ZtcqYez8LnosvRNLQ+aY4beR6EENI6wLoJawaxOTOvTx+p8j38G+z+6lGKxKl/8VphSMLuXgc=; X-YMail-OSG: 0I6roCQVM1kZEgLFjh_hKhpT8C.UYDqnnvnyLifOvKQGvIff1ILY4sX95feCpKgx7Q-- Received: from [131.191.82.223] by web58102.mail.re3.yahoo.com via HTTP; Mon, 03 Sep 2007 20:30:46 PDT Date: Mon, 3 Sep 2007 20:30:46 -0700 (PDT) From: L Goodwin To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <813384.83992.qm@web58102.mail.re3.yahoo.com> Subject: Handling failed mount (media not connected) 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: Tue, 04 Sep 2007 03:30:48 -0000 My backup script (sh) works fine except when the backup drive (USB Flash drive) is not plugged in. I'm using mount_msdosfs to mount the backup drive. What is the best way to handle mount_msdosfs error? If the drive is not mounted, I want to detect the failure and execute error-handling code. I tried executing it in a subshell, which works when it FAILS, but not when it WORKS. Also tried trap 0, but it did not help. ____________________________________________________________________________________ Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://sims.yahoo.com/